fs.lchmod is only available on OSX, while fs.chmod is available on all platforms still it seems to have no effect on Windows. Is it just noop there? Or it has some effect in some cases?
If anyone knows the answer I'll be grateful. Thanks.
On Tue, Oct 9, 2012 at 4:03 PM, Mariusz Nowak <mari...@medikoo.com> wrote:
> fs.lchmod is only available on OSX, while fs.chmod is available on all
> platforms still it seems to have no effect on Windows.
> Is it just noop there? Or it has some effect in some cases?
> If anyone knows the answer I'll be grateful. Thanks.
fs.chmod() on windows is not exactly a no-op, it just doesn't do much.
You can flip the read and write bits and that's it.
Thanks, that clarifies. I understand that is also works for files only? at least I think there's no effect when trying to change bits for directories (?)
On Tuesday, October 9, 2012 4:14:05 PM UTC+2, Ben Noordhuis wrote:
> On Tue, Oct 9, 2012 at 4:03 PM, Mariusz Nowak <mar...@medikoo.com<javascript:>> > wrote: > > fs.lchmod is only available on OSX, while fs.chmod is available on all > > platforms still it seems to have no effect on Windows. > > Is it just noop there? Or it has some effect in some cases?
> > If anyone knows the answer I'll be grateful. Thanks.
> fs.chmod() on windows is not exactly a no-op, it just doesn't do much. > You can flip the read and write bits and that's it.
On Tuesday, October 9, 2012 4:14:05 PM UTC+2, Ben Noordhuis wrote:
> fs.chmod() on windows is not exactly a no-op, it just doesn't do much. > You can flip the read and write bits and that's it.
I fact, you can only flip the write bit. If you take it away, the readonly bit is set on the file.
On Tuesday, October 9, 2012 4:19:17 PM UTC+2, Mariusz Nowak wrote:
> Thanks, that clarifies. I understand that is also works for files only? at > least I think there's no effect when trying to change bits for directories > (?)
It works on directories as well, but the effect of the readonly bit is different for directories. It will still be possible to remove the directory, create new files in it etc., but new files that are added "inherit" the readonly bit from the directory they are created in.