From: Gavin Kistner Date: 2005-09-27T21:58:24+09:00 Subject: Re: changing permissions in windows XP using ruby!! On Sep 27, 2005, at 1:16 AM, kraf001 wrote: > I am writing an application in ruby ([U]to run in windows XP[/U]) ... [snip] > I tried to give permissions to everyone (as I would do in Linux using > chmod 0777 filename) by using the code: > > f = File.new(path, "a+") > puts File.chmod(0777,path) From the documentation for the File class: [Slim:~] gavinkis% ri File ...[snip]... On non-Posix operating systems, there may be only the ability to make a file read-only or read-write. In this case, the remaining permission bits will be synthesized to resemble typical values. For instance, on Windows NT the default permission bits are +0644+, which means read/write for owner, read-only for all others. The only change that can be made is to make the file read-only, which is reported as +0444+. (Or see it in glorious HTML at http://phrogz.net/ProgrammingRuby/ ref_c_file.html)