File size error in os.stat with large files.

Tim Peters tim_one at email.msn.com
Wed Jul 10 00:02:36 EDT 2002


[someone]
> You have to compile python with large file support to handle files
> over 2GB.  To test whether you have this enabled:

[Matt Gerrans]
> Do you know why the binaries are not compiled with large file
> support as default?

[Skip Montanaro]
> I suspect it allows the same binaries to run on a larger number of Windows
> versions.

"Even Win95" supports 64-bit file sizes and offsets via the Win32 API, which
has long supported them (albeit that Win95 didn't support any filesystem
capable of storing such large files)!  That's not the problem, and there's
no compile trick you can use in Python 2.1 or earlier to get large files to
"work right" under any flavor of Windows.  Those versions of Python used
"the usual" assortment of C functions under Windows, and Microsoft's
implementations of those just plain don't work for large files.  All the
relevant Windows file code in Python was rewritten for 2.2, to use crankier
functions that do work with large files (and on any Win32 box).

The only cures are to move to Python 2.2.1 (then it just works out of the
box), or eschew portable Python file operations and code to the Win32 API by
hand.

"large-file-support"-means-something-different-on-every-platform-
    and-counting-unix-as-a-dozen-distinct-platforms-ly y'rs  - tim






More information about the Python-list mailing list