tags:

views:

93

answers:

3
mkdir("/path/to/my/dir", 0700);

Thanks

+10  A: 

Yes. The leading zero will make the number interpreted as octal number; without it would be interpreted as decimal number.

var_dump(0700); // int(448)
var_dump(700);  // int(700)
Gumbo
But in bash environment I always use `chmod 777`,without 0,and it seems to be working.
symfony
chmod command in bash is smart enough to know it's octal.
Aziz
Well technically it is not needed. It just makes it a hell of a lot easier to read.
Martin York
+3  A: 

Yes. It's an octal literal

Denis Krjuchkov
+4  A: 

The leading zero indicates an octal value. See also the documentation of chmod.

middus