We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sample code:
var fs; fs = require('fs'); try { fs.unlinkSync('a'); } catch (_error) {} fs.writeFileSync('a', 'ok', { mode: 0o777 }); console.log(fs.statSync('a').mode.toString(8)); // output => 0o755 fs.chmodSync('a', 0o777); console.log(fs.statSync('a').mode.toString(8)); // output => 0o777
It should output 0o777. But I get 0o755. If I use the fs.chmod to change mode, everything will go well.
0o777
0o755
fs.chmod
The text was updated successfully, but these errors were encountered:
That's the umask at work:
> (0o777 & ~process.umask()).toString(8) '755'
Not a bug, it's just the way UNIX permissions work.
Sorry, something went wrong.
@bnoordhuis But why chmod doesn't follow the umask?
@ysmood Because the umask applies to just a handful of functions (open, mkdir, etc.)
No branches or pull requests
Sample code:
It should output
0o777
. But I get0o755
.If I use the
fs.chmod
to change mode, everything will go well.The text was updated successfully, but these errors were encountered: