Reputation: 1904
So I have a Ruby script where I am moving files around and whatnot and, at a point in it, I need to set the permissions for some files so that when viewed from a UNIX machine, the permissions are being reflected accurately. The problem is, I am running the script from a Windows 64-bit machine and it doesn't seem to have any effect on the files when I view them from the UNIX machine.
Here is my example code for the permissions:
FileUtils.chmod(0777, "file")
And that seems to have zero effect on the file. When I check it in UNIX, it has permissions rw-rw-r
.
Upvotes: 2
Views: 2410
Reputation: 10378
File.chmod
is a no-op operation on Windows since neither NTFS or FAT support that kind of permissions.
Even worse, Windows, through Samba (SMB) file sharing will not know that the files you're trying to modify are located in an UNIX environment.
If you need to apply UNIX-like permissions, then you will need to perform that operation from a version of Ruby running on a UNIX operating system.
Upvotes: 2