Message29150
Python 2.5b1 (r25b1:47027, Jun 20 2006, 09:31:33)
Assuming documentation is correct: (from seek() help
"Note that if the file is opened for appending (mode
'a' or 'a+'), any seek() operations will be undone at
the next write"
Doing the following is __not__ undoing the seek
operation after calling this a few times (Simplified
code snippet):
from __future__ import with_statement
with open(path,'a+') as f:
f.seek(0,2) # go to end
pos = f.tell()
f.seek(0,0)
line = f.readline().strip()
f.seek(0,2) # go to end, not effective if opened
with mode a/a+ (currently bug?)
f.write("something")
Calling the above code repeatedly didnt increase the
file size beyond 166 bytes (in my code)
|
|
Date |
User |
Action |
Args |
2007-08-23 14:41:19 | admin | link | issue1521491 messages |
2007-08-23 14:41:19 | admin | create | |
|