Sander Sweers wrote:
2009/3/10 Alan Gauld <alan.ga...@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.

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to