(PHP 4, PHP 5, PHP 7)
clearstatcache — 锟斤拷锟斤拷募锟阶刺拷锟斤拷锟�
$clear_realpath_cache
= false
[, string $filename
]] ) : void锟斤拷使锟斤拷 stat()锟斤拷lstat() 锟斤拷锟斤拷锟轿猴拷锟斤拷锟斤拷锟斤拷影锟届函锟斤拷锟斤拷锟斤拷锟斤拷锟芥)锟叫的猴拷锟斤拷时锟斤拷PHP 锟斤拷锟斤拷锟斤拷锟斤拷些锟斤拷锟斤拷锟侥凤拷锟斤拷锟斤拷息锟斤拷锟结供锟斤拷锟斤拷锟斤拷锟斤拷堋锟饺伙拷锟斤拷锟侥承╋拷锟斤拷锟铰o拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟较拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷一锟斤拷锟脚憋拷锟叫讹拷渭锟斤拷同一锟斤拷锟侥硷拷锟斤拷锟斤拷锟斤拷锟侥硷拷锟节此脚憋拷执锟斤拷锟节硷拷锟叫憋拷删锟斤拷锟斤拷锟睫改碉拷危锟斤拷时锟斤拷锟斤拷锟斤拷要锟斤拷锟斤拷募锟阶刺拷锟斤拷妗o拷锟斤拷锟斤拷锟斤拷锟铰o拷锟斤拷锟斤拷锟斤拷 clearstatcache() 锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟� PHP 锟斤拷锟斤拷母锟斤拷募锟斤拷锟较拷锟�
锟斤拷锟斤拷注锟斤拷锟斤拷牵锟斤拷锟斤拷诓锟斤拷锟斤拷诘锟斤拷募锟斤拷锟絇HP 锟斤拷锟斤拷锟结缓锟斤拷锟斤拷锟斤拷息锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟�
file_exists() 锟斤拷锟斤拷椴伙拷锟斤拷诘锟斤拷募锟斤拷锟斤拷诟锟斤拷募锟矫伙拷斜锟斤拷锟斤拷锟街帮拷锟斤拷锟斤拷锟斤拷岱碉拷锟�
FALSE
锟斤拷锟斤拷锟斤拷锟斤拷募锟斤拷锟斤拷锟斤拷锟斤拷耍锟斤拷锟斤拷锟斤拷院锟缴撅拷锟斤拷锟斤拷锟斤拷锟斤拷岱碉拷锟� TRUE
锟斤拷锟斤拷 unlink() 锟斤拷锟皆讹拷锟斤拷锟斤拷没锟斤拷锟�.
Note:
锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟截讹拷锟侥硷拷锟斤拷锟斤拷锟斤拷息锟斤拷锟斤拷锟街伙拷诙锟酵伙拷锟斤拷募锟斤拷锟斤拷锟斤拷卸锟轿诧拷锟斤拷锟斤拷锟斤拷锟斤拷要锟斤拷锟侥硷拷锟斤拷息锟斤拷锟斤拷锟斤拷锟斤拷时锟斤拷锟斤拷要锟斤拷锟斤拷 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()锟斤拷
clear_realpath_cache
锟角凤拷锟斤拷锟斤拷锟绞德凤拷锟斤拷锟斤拷锟�
filename
锟斤拷锟斤拷募锟斤拷锟街革拷锟斤拷锟斤拷募锟斤拷锟斤拷锟绞德凤拷锟斤拷锟斤拷锟�; 只锟斤拷
clear_realpath_cache
为 TRUE
时锟斤拷锟斤拷
没锟叫凤拷锟斤拷值锟斤拷
锟芥本 | 说锟斤拷 |
---|---|
5.3.0 |
锟斤拷锟斤拷锟剿匡拷选锟斤拷 clear_realpath_cache
锟斤拷 filename 锟斤拷锟斤拷.
|
Example #1 clearstatcache() 锟斤拷锟斤拷
<?php
$file = 'output_log.txt';
function get_owner($file)
{
$stat = stat($file);
$user = posix_getpwuid($stat['uid']);
return $user['name'];
}
$format = "UID @ %s: %s\n";
printf($format, date('r'), get_owner($file));
chown($file, 'ross');
printf($format, date('r'), get_owner($file));
clearstatcache();
printf($format, date('r'), get_owner($file));
?>
锟斤拷锟斤拷锟斤拷锟教碉拷锟斤拷锟斤拷锟斤拷锟斤拷冢锟�
UID @ Sun, 12 Oct 2008 20:48:28 +0100: root UID @ Sun, 12 Oct 2008 20:48:28 +0100: root UID @ Sun, 12 Oct 2008 20:48:28 +0100: ross