note 27369 added to function.fseek

From: Date: Tue, 03 Dec 2002 17:46:04 +0000
Subject: note 27369 added to function.fseek
Groups: php.notes 
Request: Send a blank email to php-notes+get-40303@lists.php.net to get a copy of this message
If you are doing error checking with fseek you must be careful. Assuming that you have a file which contains more than 22 characters The following code will not work: if(!fseek($file_pointer,22)){ echo("There was an error"); } You must use: if(fseek($file_pointer,22)!=0){ echo("There was an error"); } or if(fseek($file_pointer,22)==-1){ echo("There was an error"); } this was with php v4.0.6 -- http://www.php.net/manual/en/function.fseek.php http://master.php.net/manage/user-notes.php?action=edit+27369 http://master.php.net/manage/user-notes.php?action=delete+27369 http://master.php.net/manage/user-notes.php?action=reject+27369

« previous php.notes (#40303) next »