Posted by Wolfgang Werners-Lucchini on 06/14/05 01:45
> >The code here outputs '0'. Why?
> >----------------------------
> >$filename = "test.dat";
> >if (!file_exists($filename)) {
> > touch($filename); // Create blank file
> > chmod($filename,0666);
> >}
> >$fp=fopen($filename,'r');
> >if ($fp && !feof($fp)) echo ftell($fp); // should output nothing!
> >fclose($fp);
>
> What makes you think it should output nothing?
>
feof() should be 'true'!
if-condition ('true' && 'false') should be 'false'!
Wolfgang
Navigation:
[Reply to this message]
|