[Python-Dev] test_largefile.py failing on Linux

Jon Ribbens jon+python-dev@unequivocal.co.uk
Tue, 12 Mar 2002 02:13:58 +0000


Tim Peters <tim.one@comcast.net> wrote:
>     These functions do not modify the file offset for any open file
>     descriptions associated with the file
> 
> in the cases where the current file position is indeed beyond the truncated
> size.  A Unix geek will have to answer that.

If you write to a position beyond the end of the file, the file will
have a hole in between the previous end and where you wrote. Holes
look like zeroes when you read the file, but do not take up any space
on disk.

i.e. low-level hidden effects aside, the current file position will be
beyond the end of the file, reads will obviously return EOF and writes
will cause the file to be zero-filled from the old end to the current
position and then the new data written.