Using Python for file packing
nobody at nowhere.com
Tue Jun 30 13:30:42 CEST 2009
On Mon, 29 Jun 2009 14:16:34 -0700, Scott David Daniels wrote:
>>> Do you mean like a zip or tar file?
>> I had no idea you could access a single file from a ZIP or TAR without
>> explicitly extracting it somewhere. Thanks.
> You will find the zip format works better if you are compressing. The
> zipfile compression is per file in the archive, rather than applied to
> the entire archive (as in tarfile). The results of the tar format
> decision is that extracting the last file in a .tgz (.tar.gz) or
> .tar.bz2 (sometimes called .tbz) requires the expansion of the entire
> archive, while extraction on a .zip is reposition, read, and possibly
Even without compression, the tar format is ill-suited to random access.
If you can choose the format, use a zip file.
More information about the Python-list