Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Stange behaviour with files permissions on a windows mounted share

Reply
Thread Tools

Stange behaviour with files permissions on a windows mounted share

 
 
F. Senault
Guest
Posts: n/a
 
      11-18-2010
Hi.

I have a windows share mounted on a FreeBSD box, and I see the
following :

| 12:39 fred@ardbeg:~/glenmorangie/misc/temp% uname -a
| FreeBSD ardbeg.lacave.local 8.1-STABLE FreeBSD 8.1-STABLE #1: Wed Oct 20 18:56:00 CEST 2010 http://www.velocityreviews.com/forums/(E-Mail Removed):/usr/obj/usr/src/sys/ARDBEG amd64

| 12:39 fred@ardbeg:~/glenmorangie/misc/temp% mount
....
| //FRED@GLENMORANGIE/E$ on /data/glenmorangie/misc (smbfs)

| 12:39 fred@ardbeg:~/glenmorangie/misc/temp% touch test.txt
| 12:40 fred@ardbeg:~/glenmorangie/misc/temp% ls -la
| total 32
| drwxr-xr-x 1 fred wheel 16384 18 nov 12:40 .
| drwxr-xr-x 1 fred wheel 16384 1 jan 1970 ..
| -rwxr-xr-x 1 fred wheel 0 18 nov 12:40 test.txt

| 12:40 fred@ardbeg:~/glenmorangie/misc/temp% chmod a-w test.txt
| 12:40 fred@ardbeg:~/glenmorangie/misc/temp% ls -la
| total 32
| drwxr-xr-x 1 fred wheel 16384 18 nov 12:40 .
| drwxr-xr-x 1 fred wheel 16384 1 jan 1970 ..
| -r-xr-xr-x 1 fred wheel 0 18 nov 12:40 test.txt

| 12:40 fred@ardbeg:~/glenmorangie/misc/temp% echo "abc" > test.txt
| zsh: permission denied: test.txt

All set. (And Windows shows the file as read-only too, FWIW.)

| 12:40 fred@ardbeg:~/glenmorangie/misc/temp% ruby -v
| ruby 1.9.2p0 (2010-08-18 revision 29036) [amd64-freebsd8]

| 12:40 fred@ardbeg:~/glenmorangie/misc/temp% irb
| >> File.writable? "./test.txt"
| => true

Uh ?

| >> File.stat("./test.txt").writable?
| => false

Better.

| >> File.open("./test.txt", "w") {}
| Errno::EACCES: Permission denied - ./test.txt
| from (irb):3:in `initialize'
| from (irb):3:in `open'
| from (irb):3
| from /usr/local/bin/irb:12:in `<main>'

Ok.

And, from the Windows box itself :

| E:\temp>ruby -v
| ruby 1.9.1p429 (2010-07-02 revision 28523) [i386-mingw32]

| E:\temp>irb
| irb(main):001:0> File.writable?("./test.txt")
| => false

Good.

Is this to be expected ? Is it a bug from FreeBSD or from Ruby ?

TIA,

Fred
--
I never really understood how there could be things that would drive you
insane just because you knew them until I ran into Windows.
(Peter da Silva in the SDM)
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Share-Point-2010 ,Share-Point -2010 Training , Share-point-2010Hyderabad , Share-point-2010 Institute Saraswati lakki ASP .Net 0 01-06-2012 06:39 AM
Can't save files to mounted vhd's. Skybuck Flying Windows 64bit 4 06-02-2011 10:41 PM
webrick-webdav(gem) served files are mounted only read-only Dirk L├╝sebrink Ruby 4 01-01-2007 01:55 PM
Can't copy files to mounted partition on XP 64 Tomislav Tustonic Windows 64bit 5 09-29-2005 12:28 AM
[beginner] stange COLSPAN behaviour JL HTML 6 12-28-2003 10:49 PM



Advertisments