note 80605 added to function.clearstatcache

From: Date: Thu, 24 Jan 2008 20:35:41 +0000
Subject: note 80605 added to function.clearstatcache
Groups: php.notes 
Request: Send a blank email to php-notes+get-135384@lists.php.net to get a copy of this message
It should be noted that a call to any of those functions will cache all of the file's information, not just the information that is returned. Obviously it is clear that the following requires you to clear the cache. <?php $size1 = filesize($filename); unlink($filename); $size2 = filesize($filename); // $size2 still equals $size1, unless you cleared the stat cache in between. ?> <?php $access = fileatime($filename); unlink($filename); $size = filesize($filename); // $size will be the filesize before it was unlinked, because the filesize was cached when fileatime was called, even though the two functions wouldn't appear to have anything to do with either other. ?> Confirmed on a windows system. ---- Server IP: 209.41.74.194 Probable Submitter: 216.248.100.66 ---- Manual Page -- http://www.php.net/manual/en/function.clearstatcache.php Edit -- https://master.php.net/note/edit/80605 Del: integrated -- https://master.php.net/note/delete/80605/integrated Del: useless -- https://master.php.net/note/delete/80605/useless Del: bad code -- https://master.php.net/note/delete/80605/bad+code Del: spam -- https://master.php.net/note/delete/80605/spam Del: non-english -- https://master.php.net/note/delete/80605/non-english Del: in docs -- https://master.php.net/note/delete/80605/in+docs Del: other reasons-- https://master.php.net/note/delete/80605 Reject -- https://master.php.net/note/reject/80605 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#135384) next »