file.tell problems (1.5.2/Win32)
Bill Wilkinson
yopen at my-deja.com
Sat Jun 26 15:40:09 EDT 1999
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
>>> g.seek(5)
>>> g.tell()
5
In article <7krd1r$2oa$1 at holly.csv.warwick.ac.uk>,
esuzm at primrose.csv.warwick.ac.uk (Andrew Clover) wrote:
> I've been meeting some surprises using the seek and tell on file
objects
> recently. I don't know if these are bugs in Python or stdio, in Win32
or
> in general, or are simply broken as designed, but:
>
> - If a file is opened in 'a'ppend mode, but nothing has yet been
written to
> it, tell() returns zero.
>
> - Values returned by tell() - possibly only on a append file, I
don't know -
> seem to be randomly a bit wrong unless flush() is used before
reading.
>
> Can anyone confirm this?
>
> --
> This posting was brought to you by And Clover.
> (Sorry.)
>
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
More information about the Python-list
mailing list