[Python-Dev] test_largefile.py failing on Linux
Tim Peters
tim.one@comcast.net
Mon, 11 Mar 2002 20:54:04 -0500
I can easily enough change the Windows file.truncate() to leave the file
position alone, although it will *have* to move it if the initial position
is beyond the truncated size. I'm baffled by what
http://www.opengroup.org/onlinepubs/7908799/xsh/ftruncate.html
intends by
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.
That leaves the question of whether our docs are saying something intended
when they say:
If the optional size argument present, the file is truncated
to (at most) that size.
Do you read that as saying file.truncate() may *increase* the size of the
file? I didn't at first, but on twelfth thought I'm not sure what it's
trying to say. Perhaps it's just saying the new size will be <= the
specified size, and that "==" may or may not obtain.