Bug #10993 Updated: filesize on newly made/just opened file weirdness
| From: | swm@php.net | Date: | Mon, 21 May 2001 13:47:25 +0000 |
| Subject: | Bug #10993 Updated: filesize on newly made/just opened file weirdness | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-56046@lists.php.net to get a copy of this message | ||
ID: 10993
Updated by: swm
Reported By: wico@cnh.nl
Old-Status: Open
Status: Closed
Bug Type: Filesystem function related
Operating system:
PHP Version: 4.0.5
Assigned To:
Comments:
The results of filesize() are cached. You will need to
reload the cache for this file in order that it return the
correct result.
See clearstatcache() and filesize() documentation.
Previous Comments:
---------------------------------------------------------------------------
[2001-05-21 13:34:21] wico@cnh.nl
Hiya
run this test script and and watch the output differ depending on using filesize or not
$fp = fopen('file.test', "a+b");
//(un)comment this line
filesize('file.test');
fwrite($fp, "boe");
fclose($fp);
$fp2 = fopen('file.test', "a+b");
fseek($fp2, 0);
echo fread($fp2, filesize('file.test'));
unlink('file.test');
Greetz,
Wico
---------------------------------------------------------------------------
ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=10993&edit=2