note 25250 added to function.fseek
| From: | php-general at lists dot php dot net | Date: | Mon, 16 Sep 2002 18:25:20 +0000 |
| Subject: | note 25250 added to function.fseek | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-36758@lists.php.net to get a copy of this message | ||
Don't use filesize() on files that may be accessed and updated by parallel processes or threads
(as the filesize() return value is maintained in a cache).
Instead lock the opened file and use fseek($fp,0,SEEK_END) and ftell($fp) to get the actual filesize
if you need to perform a fread() call to read the whole file...
--
http://www.php.net/manual/en/function.fseek.php
http://master.php.net/manage/user-notes.php?action=edit+25250
http://master.php.net/manage/user-notes.php?action=delete+25250
http://master.php.net/manage/user-notes.php?action=reject+25250