note 69281 added to function.clearstatcache
| From: | admin at ethisoft dot nl | Date: | Tue, 29 Aug 2006 20:27:51 +0000 |
| Subject: | note 69281 added to function.clearstatcache | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-116490@lists.php.net to get a copy of this message | ||
function also affects calls to fopen and fread.
example:
if file.ext is a empty file,
<?php
$handle = fopen('file.ext','ab+');
$result = fwrite($handle, 'data to add to file');
fclose($handle);
$handle = fopen('file.ext', "rb");
$contents = fread($handle, filesize('file.ext'));
fclose($handle);
// $contents will be empty!!
?>
BUT,
<?php
$handle = fopen('file.ext','ab+');
$result = fwrite($handle, 'data to add to file');
fclose($handle);
clearstatcache();
$handle = fopen('file.ext', "rb");
$contents = fread($handle, filesize('file.ext'));
fclose($handle);
// $contents will contain: data to add to file
?>
----
Server IP: 194.109.193.119
Probable Submitter: 80.126.41.235
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.clearstatcache.php
Edit -- https://master.php.net/note/edit/69281
Del: integrated -- https://master.php.net/note/delete/69281/integrated
Del: useless -- https://master.php.net/note/delete/69281/useless
Del: bad code -- https://master.php.net/note/delete/69281/bad+code
Del: spam -- https://master.php.net/note/delete/69281/spam
Del: non-english -- https://master.php.net/note/delete/69281/non-english
Del: in docs -- https://master.php.net/note/delete/69281/in+docs
Del: other reasons-- https://master.php.net/note/delete/69281
Reject -- https://master.php.net/note/reject/69281
Search -- https://master.php.net/manage/user-notes.php