返回列表 回复 发帖

php clearstatcache() 函数

Definition and Usage
定义和用法

The clearstatcache() function clears the file status cache.
clearstatcache()函数的作用是:清除文件状态缓存。

PHP caches data for some functions for better performance. If a file is being checked several times in a script, you might want to avoid caching to get correct results. To do this, use the clearstatcache() function.
PHP 的缓存数据对更快更好的运行函数是非常有利的。如果一个文件在脚本中测试了多次,你也许会禁止对正确的结果进行缓存。为了实现这点,你可以使用 clearstatcache()函数。
Syntax
语法
  1. clearstatcache()
复制代码
Tips and Notes
提示和注意

Tip: Functions that are caching:
提示:执行缓存的函数:
  1.     * stat()
  2.     * lstat()
  3.     * file_exists()
  4.     * is_writable()
  5.     * is_readable()
  6.     * is_executable()
  7.     * is_file()
  8.     * is_dir()
  9.     * is_link()
  10.     * filectime()
  11.     * fileatime()
  12.     * filemtime()
  13.     * fileinode()
  14.     * filegroup()
  15.     * fileowner()
  16.     * filesize()
  17.     * filetype()
  18.     * fileperms()
复制代码
Example
案例
  1. <?php//check filesizeecho filesize("test.txt");echo "<br />";

  2. $file = fopen("test.txt", "a+");// truncate fileftruncate($file,100);fclose($file);

  3. //Clear cache and check filesize againclearstatcache();echo filesize("test.txt");?>
复制代码
The output of the code above could be:
上述代码将输出下面的结果:
  1. 792100
复制代码
Postfix技术专业支持论坛
http://www.thismail.org/bbs
-----------------------------------
提供专业postfix技术支持,邮件系统开发定制
QQ:187159779 注明(Postfix技术支持)
返回列表
开源邮件服务器 开源邮件服务器 web 开源邮件 开源 mail 开源 邮件服务器 邮件技术 mail技术 反垃圾邮件 反垃圾mail mail投递
邮件服务器 mail服务器 开源软件 mail软件 mail服务新品牌 开源邮件服务新品牌
开源mail服务新网站 邮件服务新品牌 mail tmail mailserver 163邮件 sendmail |Linux维护|Linux代维|成都Linux维护|成都Linux代维