Last active
August 29, 2015 14:21
-
-
Save mygoare/5218e009e226ae59d191 to your computer and use it in GitHub Desktop.
read permission from fs stats mode property
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var permString = '0' + (stats.mode & parseInt('777', 8)).toString(8); | |
| e.g. | |
| if stats.mode equal 33261, then it will return '0755' | |
| parseInt('0755', 8) // return 493 | |
| parseInt('0666', 8) // return 438, it is default value of node |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment