Python 1.5.2 and large files (Solaris 7)

Hrvoje Niksic hniksic at srce.hr
Tue May 25 00:15:34 EDT 1999


Steve Clift <clift at mail.anacapa.net> writes:

> I thought about making the return values switch types automatically
> depending on their magnitude, but eventually decided that was a bit
> on the weird side. The test suite ran OK with plain Python longs, so
> I left it that way. Also, getting a long back is a clue that large
> file support is enabled.

The question you have to ask yourself is whether the programmer really
needs such a clue.  I think it's a generally good idea to simply
return the correct value.  If it fits in an Int, it should be an Int,
if not, not.

Or, do you think doing so would actually break something?  I'm not
very familiar with Python's number system, but I know that Python is
unable to promote Ints to Longs automatically -- for example,
1+sys.maxint overflows, while 1L+sys.maxint doesn't.

> One other thing: on Solaris it's easier to type `getconf LFS_CFLAGS`
> than the bizarre defines in the doco, and the result is the same.

True, and it's more correct.  If you aim for full correctness, you
should also use `getconf LFS_LDFLAGS` and `getconf LFS_LIBS` for
linkage.

Speaking of configuration, I also think it would be great if you added 
support for configure to do these things, so that the user can just
write:

    ./configure --enable-large-file

...and that configure does the rest.




More information about the Python-list mailing list