Truncate beginning of a file

Marc 'BlackJack' Rintsch bj_666 at gmx.net
Mon May 5 01:14:47 EDT 2008


On Sun, 04 May 2008 22:06:42 -0700, s0suk3 wrote:

> file.truncate(X) will truncate the file to at most X bytes (i.e. leave
> the first X bytes of the file and throw away the rest). Is there a way
> to throw away, say, the first X bytes of the file, and leave the rest?
> (Without opening the same file for reading, reading and processing,
> overwriting the file with the new processed data, etc.)

No.

Ciao,
	Marc 'BlackJack' Rintsch



More information about the Python-list mailing list