note 19366 added to function.fread

From: Date: Mon, 25 Feb 2002 19:24:07 +0000
Subject: note 19366 added to function.fread
Groups: php.notes 
Request: Send a blank email to php-notes+get-27015@lists.php.net to get a copy of this message
Somebody alluded to it above, but for some reason I had the same problem opening and reading a file from the local file system, not a URL. This does not work: -- $file=fopen("suite/search/noisewords.inc","rb"); $noisewords=fread($file,filesize($file)); -- But this does: -- $file=fopen("suite/search/noisewords.inc","rb"); $noisewords=fread($file,90000); -- I just switched servers and had never had this problem before using filesize(), even though I am still on an Apache on Linux, but for some reason it was spitting out the following error: Warning: stat failed for Resource id #14 (errno=2 - No such file or directory) in /home/univers/public_html/blahblahblah/searchfunctions.php on line 8 -- http://www.php.net/manual/en/function.fread.php http://master.php.net/manage/user-notes.php?action=edit+19366 http://master.php.net/manage/user-notes.php?action=delete+19366 http://master.php.net/manage/user-notes.php?action=reject+19366

« previous php.notes (#27015) next »