too big to eat?

Steve Clift clift at mail.anacapa.net
Wed Sep 15 23:01:36 EDT 1999


Hao Zhou writes:

>I was trying to open a text file which size is 2817663929 bytes and got
>this message:
>
>IOError: [Errno 79] Value too large for defined data type:
>
>The machine is a Solaris 2.7 unix box with a few G memory and Python 1.5.2b2 
>has been compiled with large file support options.
>
>Is there any switch I can turn on to let Python chew the file?
>
>Thanks.
>Hao

I don't think Python was built correctly, or you wouldn't be getting that
error message. It's indicative that the open/read/write/seek routines
Python is linked against use 32-bit sizes and offsets rather than 64-bit
ones. One way to tell is to run os.stat() on an existing file - if the
result contains Python longs, you have large file support. If it contains
only integers, you don't.

I don't have any problem creating/opening/seeking/reading 4GB files using
1.5.2 on Solaris 2.7 x86 (admittedly with a big hole in the middle - this
machine doesn't have that much free disk space). Works OK with file objects
and the os module routines. Maybe there's a bug in 1.5.2b2 - you might try
1.5.2.

-Steve





More information about the Python-list mailing list