how to delete or change...

Shagshag13 shagshag13 at yahoo.fr
Mon Jul 22 10:41:07 EDT 2002


> There are some unknown's here that would be helpful to know.  You say
> it's a text file but then talk about opening in binary.  Is it ASCII?

yes, it's an ascii file (i try to open it in binary to do bytes operations instead of lines operations)

> How large all the files? Is it feasible for you to work in memory?

No, i can't (huge file between 1,5 and 2,5 go)

> Also, you say when you tried the binary seek you got an I/O error.
> Was there anything informative about that error that you can post?

>>> f2 = file('d:/test.txt', 'rwb')
>>> f2.seek(-5, 2)
>>> f2.read(5)
'TUR\n'
>>> f2.seek(-5, 2)
>>> f2.write('new')
Traceback (most recent call last):
  File "<pyshell#99>", line 1, in ?
    f2.write('new')
IOError: (0, 'Error')

Maybe i miss something ?

thanks in advance,

s13.





More information about the Python-list mailing list