【问题标题】:Clear cache before and after CHMOD在 CHMOD 前后清除缓存
【发布时间】:2015-08-25 10:06:32
【问题描述】:

似乎 PHP 将 chmod 信息保存在缓存中。更新后它仍然相同(成功,正如我在 FTP 中看到的那样)

执行前的CHMOD:0505

chmod($file, 0705);
echo "1 :".substr(sprintf('%o', fileperms($file)), -4)."<br>"; //print "0505"
echo "2 :".intval(substr(sprintf('%o', fileperms($file)), -4))."<br>"; // Another test, doesn't work : print "505"

我应该怎么做才能获得真正的当前 chmod ?可能吗 ?

谢谢!

【问题讨论】:

    标签: php chmod


    【解决方案1】:

    来自PHP fileperms手册:

    注意:这个函数的结果是缓存的。见 clearstatcache() 了解更多详情。

    见http://php.net/manual/en/function.clearstatcache.php

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-01-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-06-22
      • 2017-07-21
      相关资源
      最近更新 更多