In article <[EMAIL PROTECTED]>, Uwe Mayer <[EMAIL PROTECTED]> wrote:
> Friday 12 August 2005 22:12 pm paolino wrote: > [...] > >>>>>f = open('test', 'a+') > >>>>>f.read() > >> > >> '' > >> > >> -> append mode does not read from file, *not ok* > >> > >> > > This is right IMO 'a' is appending so seek(-1) > > True, thank you. > f.tell() shows the file pointer is at EOF. On my Debian Linux (unstable), > Python 2.3.4 +2.3.5, however, the file pointer is at the beginning of the > file. > Is that behaviour intended? I don't think Python pretends to have any intentions here, it has to take what it gets from the C library fopen(3) function. BSD man pages generally say a+ positions the stream at end of file (period.) They claim conformance with the ISO C90 standard. I couldn't dig up a (free) copy of that document, so don't know what it says on this matter. GNU C man pages say it positions the stream at end for write and at beginning for read. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list