note 27369 deleted from function.fseek by sniper
| From: | sniper@php.net | Date: | Thu, 13 Feb 2003 05:32:58 +0000 |
| Subject: | note 27369 deleted from function.fseek by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-43864@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