[Tutor] memory error files over 100MB

Lie Ryan lie.1296 at gmail.com
Wed Mar 11 02:26:16 CET 2009


Sander Sweers wrote:
> 2009/3/10 Alan Gauld <alan.gauld at btinternet.com>:
>>>           newFile.write(zf.read(zfilename))
>> Remember you are reading the file into memory and then writing it
>> out again in a single operation, that will use twice the space of the
>> uncompressed files - plus some extra for overhead.
> 
> Question, Do you mean the file in the zipfile (zfilename) or the whole
> zipfile (zf)? I would expect zf.read(zfilename) to only read the
> requested file in the zipfile.

I've never used zipfile extensively, but I think it depends on the 
archive and the compression algorithm. Solid archive (multiple files 
compressed as a single big file) may need to be fully extracted, except 
if the algorithm can somehow figure out a way of extracting a single 
file from a solid archive without extracting everything first.



More information about the Tutor mailing list