note 47615 deleted from function.chmod by tomsommer

From: Date: Tue, 23 Nov 2004 00:13:48 +0000
Subject: note 47615 deleted from function.chmod by tomsommer
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-80898@lists.php.net to get a copy of this message
Note Submitter: Matt ---- Another developer kindly helped me out in understanding why chmod wasn't delivering the permissions desired on a linux/ensim server. Seems there were default permissions of 222 being applied and all we needed to do was use umask first. Hope this input helps other out there facing similarly problems: $old_umask = umask(0); mkdir($AVar,0777); chmod($AnOtherVAR,0777); umask($old_umask); Using umask() did the trick when we didn't we found that: mkdir($AVar,0777); chmod($AnOtherVAR,0777); actually gave us permissions of 555 or something like that. I may have remembered the specifics wrong but the message is try umask() if facing odd permissions when using chmod. http://uk2.php.net/manual/en/function.umask.php ---- Reason: useless example

« previous php.notes (#80898) next »