Re: bug in mkdir? [SOLVED]
| From: | Mike Wright | Date: | Thu, 10 Jun 2010 18:54:04 +0000 |
| Subject: | Re: bug in mkdir? [SOLVED] | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-306015@lists.php.net to get a copy of this message | ||
Ashley Sheridan wrote:
On Thu, 2010-06-10 at 11:32 -0700, Mike Wright wrote:Hi, Ash. Thanks for the help.Hi all, Using 5.2.9 I'm trying to create a directory but it is being created with incorrect permissions. I'm following the online manual. This is the command being used:mkdir('/srv/www/domain/data/R1276190214358/thumbs', 0770, true);This is what is created:drwxr-x--- 2 apache apache 4096 2010-06-10 10:33 R1276190214358Isn't that supposed to be 0770 instead of 0750? Either the manual is wrong, the command is broken, or I'm screwing it up (most likely). Thanks for any help, Mike Wright
Did the R1276190214358 directory already exist?No. If so, it will retain
the permissions it had, and only the thumbs sub-directory within it will have the new permissions. Also, is this on a shared hosting server? It could be that a security restriction in-place is not allowing the permissions to be configured as the directory is written, and you may have to manually update them with the chmod() function.It's under my control. Solution: run umask(000) first. (of the 3 choices above it turned out to be #3 ;(