#19757 [Opn->Bgs]: odd mkdir vrs chmod fileperms

From: Date: Fri, 04 Oct 2002 19:35:28 +0000
Subject: #19757 [Opn->Bgs]: odd mkdir vrs chmod fileperms
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-21507@lists.php.net to get a copy of this message
ID: 19757 Updated by: iliaa@php.net Reported By: fandelem@hotmail.com -Status: Open +Status: Bogus Bug Type: Directory function related Operating System: linux 2.4.9-7 PHP Version: 4.2.0 New Comment: Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php The mkdir call is affected by umask. Since on most systems (unix) default umask is 022 when it is applied to mode 0777 you get 755 directory permission. To avoid this problem, do a call umask(0), before creating a directory. Previous Comments: ------------------------------------------------------------------------ [2002-10-04 14:31:05] fandelem@hotmail.com This is reproducable, though very odd. I have a script that does this: mkdir("fandelem",0777); which when I issue 'ls -la' produces: drwxr-xr-x 2 apache apache 4096 Oct 4 11:16 fandelem However when I add: chmod("fandelem",0777); which when I issue 'ls -la' produces: drwxrwxrwx 2 apache apache 4096 Oct 4 11:19 fandelem ------------- I don't really understand why -- and I guess I could just have the code do an extra chmod() but I found it quite odd that this happens. -kyle ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=19757&edit=1

« previous php.bugs (#21507) next »