Phpfileatime? What if the last access time cannot be obtained? Php fileatime
$ File = 'image/open1.txt ';
$ Fopen = fopen ($ file, 'r ');
$ Content = fread ($ fopen, filesize ($ file ));
Echo $ content;
Date_default_timezone_set ('Asia/Chongqing ');
Echo date ("Y, m, d, H: I: s", fileatime ($ file ));
Fclose ($ file );
?>
No matter how many times the page is refreshed or accessed again, the page display time remains unchanged at 20:03:31, January 1, December 05, 2013.
Why?
Reply to discussion (solution)
Http://php.net/manual/en/function.fileatime.php
Note:
The atime of a file is supposed to change whenever the data blocks of a file are being read. this can be costly performance-wise when an application regularly accesses a very large number of files or directories.
Some Unix filesystems can be mounted with atime updates disabled to increase the performance of such applications; USENET news spools are a common example. On such filesystems this function will be useless.
Different file systems will be used differently ..
You can try clearstatcache () to clear the cache and then read it.
There is a problem with your code writing. it is clear that the cache and access time remain unchanged.