Posted by kicken on 06/15/05 06:53
Wolfgang Werners-Lucchini wrote:
>>>> What makes you think it should output nothing?
>>>>
>>>
>>>feof() should be 'true'!
>>
>> Why?
>
>
> The manual says:
> Returns TRUE if the (file pointer is at EOF(1)) or (an error occurs(2))
>
> It says NOT:
> Returns TRUE if an error occurs
>
> or bettert
> Returns TRUE if an READerror occurs
>
> For an empty file EOF-position is 0 (EOF-position is n for file with
> filesize n)
>
> Wolfgang
>
>
>
When you first open a file, no check is done to see what position the
file is actually at. EOF is an error condition, if you go down to the
roots of C, which php's functions are based on. EOF is an error flag
that is set when you reach the end of the file. You can't reach
anything without doing some sort of reading operation though. See the
discussion on devshed for a detailed discussion
http://forums.devshed.com/t244304/s.html&highlight=feof
[Back to original message]
|