note 96973 deleted from function.mkdir by danbrown
| From: | danbrown@php.net | Date: | Thu, 25 Mar 2010 18:03:11 +0000 |
| Subject: | note 96973 deleted from function.mkdir by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-167412@lists.php.net to get a copy of this message | ||
Note Submitter: jack dot sleight at gmail dot com
----
When using the recursive parameter only the last directory is given the mode you specify. ie:
<?php
mkdir('/test1/test2/test3', 0777, true);
?>
May result in something like this:
test1 - 0755 (or whatever the default umask may be)
test2 - 0755 (or whatever the default umask may be)
test3 - 0777
This might be obvious to some, but it tripped me up when I was expecting 0777 on all created
directories in the path.