note 49526 deleted from function.umask by googleguy
| From: | googleguy@php.net | Date: | Tue, 22 Oct 2013 10:14:30 +0000 |
| Subject: | note 49526 deleted from function.umask by googleguy | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-196927@lists.php.net to get a copy of this message | ||
Note Submitter: trisk at earthling dot net
----
I thought I would clarify the numbering scheme used here, as it confused me at first.
On the UNIX console, the command:
umask "blah"
In this instance, the umask command forces "blah" to be an octal number, regardless of how
many digits you use and regardless of any leading zeroes. In PHP, umask() does not default to octal
as the console command does, it uses whatever numeric format you specify.
For example:
umask(213);
This uses the decimal integer 213 and not the octal number 213 as you would expect when using the
console command. In this case, it would set the umask to the octal number "325".
To enter the number as octal, just add one or more zeroes to the left of the number:
umask(0213);
umask(07);
umask(0044);
etc.