large file support

Fred Clare fred at balzac.scd.ucar.edu
Fri Oct 20 20:13:09 EDT 2000


How does one read large files into Python?  I have a 4 gigabyte
file on an SGI (that has over 30 GB main memory), but when I use

  f = open("file","rb")
  s = f.read()

on this file, I get "MemoryError".  Trying the I/O from the os module 
produces the same result.  In fact I get the MemoryError even when 
trying to read 2GB files.  When I run configure before building python, it
indicates that large file support *is* enabled.

I searched DejaNews and there are some entries indicating that
large file support is possible, but I could not find where
anyone had actually done it.

-- 
Fred Clare
fred at ucar.edu



More information about the Python-list mailing list