[Tutor] Moving file pointer (original) (raw)

Bob Gailer bgailer at alum.rpi.edu
Thu Jul 29 20:34:47 CEST 2004


At 12:03 PM 7/29/2004, Gus Tabares wrote:

I'm trying to set the file pointer for a file on a posix machine. For instance, I have a simple 5-byte file with data 'abcde'. I want to 'extend' the file to 10-bytes, but not initialize any data in those extra 5-bytes. They should be all zeros.

This is analogous to win32file.SetFilePointer routine. Does anyone have any pointers (no pun intended) to a solution?

We have no OBJECTion to puns. And Python is a pointerless language ( or else its all pointers under the covers ).

Best I can think of is to write 5 zero bytes at the end of the file.

Bob Gailer bgailer at alum.rpi.edu 303 442 2625 home 720 938 2625 cell



More information about the Tutor mailing list