file.tell problems (1.5.2/Win32)
Greg Ewing
greg.ewing at compaq.com
Sun Jun 27 23:34:59 EDT 1999
Bill Wilkinson wrote:
>
> hmmm.... not too sure what your asking, here is a session on my NT box.
>
> >>> g = open("c:\\temp\\trick.ini","a")
> >>> g.tell()
> 0
The problem is, tell() returns 0 at this point
even if the file being appended to is NOT EMPTY!
Witness:
>>> f = open("blarg.txt")
>>> print f.read()
echo Pan galactic gargle blaster
>>> f.close()
>>> f = open("blarg.txt", "a")
>>> f.tell()
0
>>> f.write("furbie")
>>> f.tell()
42
Only after something has been written does tell()
return the correct file position.
Greg
More information about the Python-list
mailing list