fileperms() 函数返回文件或目录的权限。
若成功,则返回文件的访问权限。若失败,则返回 false。
fileperms(filename)
提示:本函数的结果会被缓存。请使用 clearstatcache() 来清除缓存。
<?php echo fileperms("test.txt"); ?>
输出:
33206
以八进制值返回权限:
<?php echo substr(sprintf("%o",fileperms("test.txt")),-4); ?>
1777