Daniel Berger
11/17/2006 1:44:00 PM
App Ra wrote:
> I'm trying to change permission on a file on a windows machine. This
> should work according to the documentation (may be i'm missing something
> here). But it doesn't
> here is the code:
>
> # take away read permission
> new_permission = File.lstat("testfile").mode ^ 0004
> File.chmod(new_permission, "testfile" )
> File.readable?("testfile") #=> true
Windows only supports two modes for File.chmod - 0644 (read/write) or
0444 (readonly).
You can use advanced attribute and security settings with the
win32-file package. However, you cannot make a file unreadable on
Windows except perhaps through ACL.
Regards,
Dan
PS - File.lstat is the same as File.stat on Windows.