Hier mal ein paar Beispiele:
- 777 wird 411
- 755 wird 363
- 644 wird 204
- 640 wird 200Nur 000 bleibt 000, was aber keinem etwas bringt. Was mache ich falsch?
http://www.php.net/manual/en/function.chmod.php
BEWARE using quotes around the second parameter...
If you use quotes eg
chmod (file, "0644");
php will not complain but will do an implicit conversion to an int before running chmod. Unfortunately the implicit conversion doesn't take into account the octal string so you end up with an integer version 644, which is 1204 octal
Und du castest explizit nach int obwohl chmod eine Oktalzahl erwartet - dass in der Doku steht, dass das zweite Argument $mode "int" ist möglicherweise falsch - ein paar Zeilen weiter steht
"Note that mode is not automatically assumed to be an octal value"