
Feb. 25, 2002
11:08 p.m.
On Mon, Feb 25, 2002 at 05:27:33PM +0000, Itamar Shtull-Trauring wrote:
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.
Fair enough.
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.
Ah, of course. Thanks. -Andrew.