Using nodejs chmod 777 and 0777

Using fs.chmod(path, mode, callback), I set the mode 777. This did not work. But when I installed it in 0777, it worked.

So, I want to know what is the difference between chmod 777and chmod 0777?

+4
source share
1 answer

A leading zero in 0777indicates that the number is an octal number .

An 777octal number 511is a decimal number . fs.chmod(path, 0777)and fs.chmod(path, 511)they do the same, but fs.chmod(path, 777)no.

, , 777 . , chmod unix .

+10

All Articles