Re: note 17518 added to function.mkdir
| From: | Zak Greant | Date: | Wed, 12 Dec 2001 18:44:52 +0000 |
| Subject: | Re: note 17518 added to function.mkdir | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-22553@lists.php.net to get a copy of this message | ||
On December 12, 2001 11:01 am, rhbwebpages@hotmail.com wrote:
> I wasted a few hours on this function until I realized that at least
> on some systems, you'll get unpredictable results if you try using
> "abbreviated" mode values with the mkdir() function.
>
> For example, you should always use the form mkdir($dir, 0777) and NOT
> mkdir($dir, 777), as you can use in chmod. Maybe this is obvious to
> some, but if you're having troubles getting the right permissions for
> a directory, you may want to check this first.
This is a relatively subtle mistake.
777 is a decimal number, while 0777 is an octal number equivalent to
511 decimal. This is noted in the documentation.
--
--zak