From: Mike Wright on
Ashley Sheridan wrote:
> On Thu, 2010-06-10 at 11:32 -0700, Mike Wright wrote:
>
>> 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 R1276190214358
>>
>> Isn'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
>>
>

Hi, Ash. Thanks for the help.

> 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 ;(