eof

hdante at gmail.com hdante at gmail.com
Fri Nov 23 23:43:56 EST 2007


On Nov 24, 2:24 am, MonkeeSage <MonkeeS... at gmail.com> wrote:
>
> Actually, to be a bit more technical, IO#eof acts like standard C eof
> for File objects, it only blocks / requires a previous read() on
> character devices and pipes and such. For files, it's the same as
> checking the absolute position of the file stream: f.tell ==
> File.size(f.path).

 This is not the same as ISO C. f.tell could be equal to
File.size(f.path) and eof could be false. An extra read() is required.

>
> Regards,
> Jordan




More information about the Python-list mailing list