note 101996 added to function.filesize

From: Date: Sat, 22 Jan 2011 02:58:28 +0000
Subject: note 101996 added to function.filesize
Groups: php.notes 
Request: Send a blank email to php-notes+get-175991@lists.php.net to get a copy of this message
if you recently appended something to file, and closed it then this method will not show appended data: <?php // get contents of a file into a string $filename = "/usr/local/something.txt"; $handle = fopen($filename, "r"); $contents = fread($handle, filesize($filename)); fclose($handle); ?> You should insert a call to clearstatcache() before calling filesize() I've spent two hours to find that =/ ---- Server IP: 69.147.83.197 Probable Submitter: 217.30.247.13 (proxied: 127.0.0.1) ---- Manual Page -- http://www.php.net/manual/en/function.filesize.php Edit -- https://master.php.net/note/edit/101996 Del: integrated -- https://master.php.net/note/delete/101996/integrated Del: useless -- https://master.php.net/note/delete/101996/useless Del: bad code -- https://master.php.net/note/delete/101996/bad+code Del: spam -- https://master.php.net/note/delete/101996/spam Del: non-english -- https://master.php.net/note/delete/101996/non-english Del: in docs -- https://master.php.net/note/delete/101996/in+docs Del: other reasons-- https://master.php.net/note/delete/101996 Reject -- https://master.php.net/note/reject/101996 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#175991) next »