seek() tell()

Peter Hansen peter at engcorp.com
Wed Feb 5 22:15:13 EST 2003


Erik Max Francis wrote:
> 
> Peter Hansen wrote:
> 
> > You can do tell only, though, can't you?
> 
> Yes, but even then only on some files:
> 
> >>> import sys
> >>> sys.stdin.tell()
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
> IOError: [Errno 29] Illegal seek

Fair enough.  I think, though, that all he was doing
was using tell() to try to identify the change in 
position of the write pointer in order to see how much
data was written out.  Since he had probably opened the
file himself, I suspect the comment above doesn't apply.

If he posts some more information, we might learn whether
he needs to use (or was already using?) wb+ or whatever.

-Peter




More information about the Python-list mailing list