Skip to content

Instantly share code, notes, and snippets.

@kamilogorek kamilogorek/666.js Secret
Created Feb 18, 2015

Embed
What would you like to do?
permissions-article-gists
Initial mode: 0666(8) = 110110110(2) // user r/w, group r/w, other r/w
Process mask: 022(8) = 000010010(2)
Reversed process mask: 0755(8) = 111101101(2) // user r/w/x, group r/x, other r/x
Initial mode AND reversed mask: 0644(8) = 110100100(2) // user r/w, group r, other r
Initial mode: 0777(8) = 111111111(2) // user r/w/x, group r/w/x, other r/w/x
Process mask: 022(8) = 000010010(2)
Reversed process mask: 0755(8) = 111101101(2) // user r/w/x, group r/x, other r/x
Initial mode AND reversed mask: 0755(8) = 111101101(2) // user r/w/x, group r/x, other r/x
fs.mkdir(path[, mode], callback);
var mode = 0777 & ~process.umask();
fs.writeFile(filename, data[, options], callback);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.