Re: File read-write mode: problem appending after reading

2006-10-16 Thread Frederic Rentsch
Tim Peters wrote: > [Frederic Rentsch] > >> Thanks a lot for your input. I seemed to notice that everything >> works fine without setting the cursor as long as it stops before the end >> of the file. Is that also a coincidence that may not work? >> > > "if you want to read following

Re: File read-write mode: problem appending after reading

2006-10-14 Thread Tim Peters
[Frederic Rentsch] > Thanks a lot for your input. I seemed to notice that everything > works fine without setting the cursor as long as it stops before the end > of the file. Is that also a coincidence that may not work? "if you want to read following a write, or write following a read, on

Re: File read-write mode: problem appending after reading

2006-10-14 Thread Frederic Rentsch
Tim, Thanks a lot for your input. I seemed to notice that everything works fine without setting the cursor as long as it stops before the end of the file. Is that also a coincidence that may not work? Frederic Tim Peters wrote: > [Frederic Rentsch] > >>Working with read and write

Re: File read-write mode: problem appending after reading

2006-10-13 Thread Tim Peters
[Frederic Rentsch] >Working with read and write operations on a file I stumbled on a > complication when writes fail following a read to the end. > > >>> f = file ('T:/z', 'r+b') > >>> f.write ('abcdefg') > >>> f.tell () > 30L > >>> f.seek (0) > >>> f.read () > 'abcdefg' > >>> f.flush ()

File read-write mode: problem appending after reading

2006-10-13 Thread Frederic Rentsch
Hi all, Working with read and write operations on a file I stumbled on a complication when writes fail following a read to the end. >>> f = file ('T:/z', 'r+b') >>> f.write ('abcdefg') >>> f.tell () 30L >>> f.seek (0) >>> f.read () 'abcdefg' >>> f.flush () # Calling or not makes no dif