EOF for binary?

flamesrock flamesrock at gmail.com
Fri Jan 7 20:17:52 EST 2005


Hi,

So if I understand correctly, there are NO eof characters in any binary
file. If so, is there an easier way to check for the end of the file
than:

os.path.getsize(infile) <= infile.tell()

Because that returns the error:
#  File "/usr/lib/python2.3/posixpath.py", line 142, in getsize
#    return os.stat(filename).st_size
#TypeError: coercing to Unicode: need string or buffer, file found
for me.


-thanks in advance
flamesrock




More information about the Python-list mailing list