note 31259 added to function.fileperms
| From: | jpgiot at rack1 dot php dot net | Date: | Tue, 15 Apr 2003 15:39:36 +0000 |
| Subject: | note 31259 added to function.fileperms | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-46647@lists.php.net to get a copy of this message | ||
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);
}
--
http://www.php.net/manual/en/function.fileperms.php
http://master.php.net/manage/user-notes.php?action=edit+31259
http://master.php.net/manage/user-notes.php?action=delete+31259
http://master.php.net/manage/user-notes.php?action=reject+31259