note 87613 added to function.fileperms
| From: | remy dot damour at nospamthankyou dot laposte dot net | Date: | Fri, 12 Dec 2008 19:08:04 +0000 |
| Subject: | note 87613 added to function.fileperms | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-148094@lists.php.net to get a copy of this message | ||
to @Martin:
In fact decoct does not always return a 6-digit long int (or 6-char long string), therefore function
calls you indicated do not always work (ex: decoct() returned "40755" =>
substr("40755", 3) returned "55" where "755" was expected).
Instead I used: (minus sign used on second parameter)
<?php
substr(decoct(fileperms("test.html")),-3); // Displays 666 or 777 (depends on chmod set)
substr(decoct(fileperms("test.html")),-4); // Displays 0666 or 0777 and refers immediately
to the number set with chmod();
?>
Thx,
Remy
----
Server IP: 130.206.1.5
Probable Submitter: 81.202.179.198
----
Manual Page -- http://www.php.net/manual/en/function.fileperms.php
Edit -- https://master.php.net/note/edit/87613
Del: integrated -- https://master.php.net/note/delete/87613/integrated
Del: useless -- https://master.php.net/note/delete/87613/useless
Del: bad code -- https://master.php.net/note/delete/87613/bad+code
Del: spam -- https://master.php.net/note/delete/87613/spam
Del: non-english -- https://master.php.net/note/delete/87613/non-english
Del: in docs -- https://master.php.net/note/delete/87613/in+docs
Del: other reasons-- https://master.php.net/note/delete/87613
Reject -- https://master.php.net/note/reject/87613
Search -- https://master.php.net/manage/user-notes.php