note 47615 added to function.chmod

From: Date: Mon, 22 Nov 2004 23:40:13 +0000
Subject: note 47615 added to function.chmod
Groups: php.notes 
Request: Send a blank email to php-notes+get-80895@lists.php.net to get a copy of this message
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 ---- Manual Page -- http://www.php.net/manual/en/function.chmod.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+47615 Delete -- http://master.php.net/manage/user-notes.php?action=delete+47615&report=yes Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+47615&report=yes&reason=bad+code Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+47615&report=yes&reason=spam Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+47615&report=yes&reason=useless+example Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+47615&report=yes&reason=contains+commercial+links Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+47615&report=yes&reason=useless+note Reject -- http://master.php.net/manage/user-notes.php?action=reject+47615&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#80895) next »