[Python-Dev] Re: [Python-checkins] CVS: python/dist/src/Objects fileobject.c,2.91,2.92

Thomas Wouters thomas@xs4all.net
Mon, 13 Nov 2000 23:41:21 +0100


On Mon, Nov 13, 2000 at 05:36:06PM -0500, Guido van Rossum wrote:

> After a bit of grepping, it seems that HAVE_LARGEFILE_SUPPORT reliably
> means that the low-level system calls (lseek(), stat() etc.)  support
> large files, through an off_t type that is at least 8 bytes (assumed
> to be equivalent with a long long in some places, given the use of
> PyLong_FromLongLong() and PyLong_AsLongLong()).

> But the problems occur in fileobject.c, where we're dealing with the
> stdio library.  Not all stdio libraries seem to support long files in
> the same way, and they use a different typedef, fpos_t, which may be
> larger or smaller in size than off_t.

This isn't the problem. The problem is that we assume that because off_t is
8 bytes, we have_LARGE_FILE_SUPPORT. This isn't true. On BSDI, off_t *is* 8
bytes, but none of the available fseek/ftell variations take an off_t as
argument ;P The TELL64() workaround works around that problem, but still
doesn't enable large file support, because there isn't any such support in
BSDI.

(Trust me... we've had logfiles and IP-traffic databases truncated because
of that... 2Gb is the limit, currently, on BSDI.)

-- 
Thomas Wouters <thomas@xs4all.net>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread!