当使用以下函数时,会因为文件状态缓存,导致结果错误
stat(), lstat(), file_exists(), is_writable(), is_readable(), is_executable(), is_file(), is_dir(), is_link(), filectime(), fileatime(), filemtime(), fileinode(), filegroup(), fileowner(), filesize(), filetype() , fileperms()
解决办法:在使用这些函数前,使用 clearstatcache ( ) 清除缓存带来的影响
stat(), lstat(), file_exists(), is_writable(), is_readable(), is_executable(), is_file(), is_dir(), is_link(), filectime(), fileatime(), filemtime(), fileinode(), filegroup(), fileowner(), filesize(), filetype() , fileperms()
解决办法:在使用这些函数前,使用 clearstatcache ( ) 清除缓存带来的影响
本文介绍由于文件状态缓存导致的函数结果错误问题,并提供了解决方案。受影响的函数包括 stat(), lstat(), file_exists() 等。建议在使用这些函数前调用 clearstatcache() 清除缓存。
176

被折叠的 条评论
为什么被折叠?



