如何检查file permissions,而不必通过passthru()或exec()运行特定于操作系统的命令
发布于 2008-08-21 08:10:45
使用fileperms()函数
clearstatcache();
echo substr(sprintf('%o', fileperms('/etc/passwd')), -4);发布于 2008-08-21 08:09:47
您可以使用is_readable()、is_executable()等。命令。
发布于 2013-04-18 21:12:18
真正的编码者使用按位操作,而不是字符串;)这是一种更优雅的权限处理方式:
function checkPerms($path)
{
clearstatcache(null, $path);
return decoct( fileperms($path) & 0777 );
}https://stackoverflow.com/questions/19466
复制相似问题