
Feb. 25, 2002
5:27 p.m.
Andrew Bennetts wrote:
I considered that, but when would a log file ever want to do otherwise?
"a" also screws up seek()s, which I'll need for the remote log viewing service. In general, "a" seems like a bad idea since its behavior is inconsistent.
I'd be interested to know what a portable way to append to a file is, though.
# assuming "file" exists f = open("file", "r+") f.seek(0, 2) see the code I checked in for a complete example.