note 31259 deleted from function.fileperms by aidan
| From: | aidan@php.net | Date: | Sat, 10 Jul 2004 13:27:11 +0000 |
| Subject: | note 31259 deleted from function.fileperms by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-72993@lists.php.net to get a copy of this message | ||
Note Submitter: jpgiot at ifrance dot com
----
if you want a have also the strange bits (SUID SGID sticky) you can replace -3 by -4 in substring
like this :
function get_octal_mode($filepath)
{
$decperms = fileperms($filepath);
$octalperms = sprintf("%o",$decperms);
// -4 value should include ugo and strange bits for files and folders
return substr($octalperms,-4);
}