nie testowałem, ale z manuala do chmoda w komentarzach było coś takiego:
<?php
function getmod($filename) {
$val = 0;
// Owner; User
$val += (($perms & 0x0100) ? 0x0100 : 0x0000); //Read
$val += (($perms & 0x0080) ? 0x0080 : 0x0000); //Write
$val += (($perms & 0x0040) ? 0x0040 : 0x0000); //Execute
// Group
$val += (($perms & 0x0020) ? 0x0020 : 0x0000); //Read
$val += (($perms & 0x0010) ? 0x0010 : 0x0000); //Write
$val += (($perms & 0x0008) ? 0x0008 : 0x0000); //Execute
// Global; World
$val += (($perms & 0x0004) ? 0x0004 : 0x0000); //Read
$val += (($perms & 0x0002) ? 0x0002 : 0x0000); //Write
$val += (($perms & 0x0001) ? 0x0001 : 0x0000); //Execute
// Misc
$val += (($perms & 0x40000) ? 0x40000 : 0x0000); //temporary file (01000000)
$val += (($perms & 0x80000) ? 0x80000 : 0x0000); //compressed file (02000000)
$val += (($perms & 0x100000) ? 0x100000 : 0x0000); //sparse file (04000000)
$val += (($perms & 0x0800) ? 0x0800 : 0x0000); //Hidden file (setuid bit) (04000)
$val += (($perms & 0x0400) ? 0x0400 : 0x0000); //System file (setgid bit) (02000)
$val += (($perms & 0x0200) ? 0x0200 : 0x0000); //Archive bit (sticky bit) (01000)
return $val;
}
?>
ogólnie to
fileperms" title="Zobacz w manualu PHP" target="_manual