How do I use chmod with Node.js?
There is a method in the package fs
, which should do this, but I don't know what it takes as the second argument.
fs.chmod(path, mode, [callback])
Asynchronous chmod(2). No arguments other than a possible exception are given to the completion callback.
fs.chmodSync(path, mode)
Synchronous chmod(2).
(from the Node.js documentation)
If I do something like
fs.chmodSync('test', 0755);
nothing happens (the file isn't changed to that mode).
fs.chmodSync('test', '+x');
doesn't work either.
I'm working on a Windows machine btw.