定义
clearstatcache()函数清除文件状态缓存。
语法
PHP clearstatcache()函数具有以下语法。
clearstatcache()
注意
缓存的函数:
- stat()
- lstat()
- file_exists()
- is_writable()
- is_readable()
- is_executable()
- is_file()
- is_dir()
- is_ ()
- filectime()
- fileatime()
- filemtime()
- fileinode()
- filegroup()
- fileowner()
- filesize()
- filetype()
- fileperms()
实例
清除文件状态缓存
<?php
/*
http://www.manongjc.com/article/1766.html
作者:码农教程
*/
echo filesize(\"test.txt\");
echo \"\\n\";
$file = fopen(\"test.txt\", \"a+\");
ftruncate($file,200);
fclose($file);
clearstatcache();
echo filesize(\"test.txt\");
?>
上面的代码生成以下结果:
46
200 继续阅读与本文标签相同的文章
下一篇 :
拥有这10个在线工具,科研事半功倍
-
宏旺半导体解答ECC与RECC内存之间的区别
2026-05-15栏目: 教程
-
2019软件著作权申请流程
2026-05-15栏目: 教程
-
苹果最新两项专利获得批准,泰坦计划仍不死
2026-05-15栏目: 教程
-
苹果手机图片格式独特,该如何转换成常用格式?
2026-05-15栏目: 教程
-
传统数据仓库和云数据仓库的区别
2026-05-15栏目: 教程
