note 93180 added to function.fileperms
| From: | meecrob at k42b3 dot com | Date: | Thu, 27 Aug 2009 14:02:48 +0000 |
| Subject: | note 93180 added to function.fileperms | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-159923@lists.php.net to get a copy of this message | ||
There seems a little bit confusion on the last two post about how to display the fileperms like 666
or 0666.
When you have a file fileperms() returns i.e. 100666
<?php
substr(decoct(fileperms('foo.txt')), 3); # 666
substr(decoct(fileperms('foo.txt')), 2); # 0666
?>
if you have a dir fileperms() returns i.e. 40777
<?php
substr(decoct(fileperms('.')), 2); # 777
substr(decoct(fileperms('.')), 1); # 0777
?>
So both are right. Note I have currently tested this on an windows box so I dont know how the
function behave under a different OS.
----
Server IP: 217.160.72.57
Probable Submitter: 80.132.122.158
----
Manual Page -- http://www.php.net/manual/en/function.fileperms.php
Edit -- https://master.php.net/note/edit/93180
Del: integrated -- https://master.php.net/note/delete/93180/integrated
Del: useless -- https://master.php.net/note/delete/93180/useless
Del: bad code -- https://master.php.net/note/delete/93180/bad+code
Del: spam -- https://master.php.net/note/delete/93180/spam
Del: non-english -- https://master.php.net/note/delete/93180/non-english
Del: in docs -- https://master.php.net/note/delete/93180/in+docs
Del: other reasons-- https://master.php.net/note/delete/93180
Reject -- https://master.php.net/note/reject/93180
Search -- https://master.php.net/manage/user-notes.php