Tarfile .bz2

Aidan Steele aidan at aidans.org
Mon Dec 11 22:49:43 EST 2006


As far as I know, tar.gz and tar.bz2 files work in exactly the same way, but
use different algorithms. That is to say, all the files are 'tarballed'
together, then the resulting very long string is run through the gz bz2
algorithm and out pops the compressed file. (These compression algorithms
work on arbitrary strings, not files per se.)

Why are you trying to losslessly compress JPG and PNG files? Chances are you
won't be able to compress them any more, but if you're trying to free space,
take a looksy at "pngcrush". You'll find it on Google - I don't want to put
any hyperlinks in this email lest it is marked as spam.

Hope I've helped,
Aidan.

On 11 Dec 2006 17:32:58 -0800, Jordan <jordan.taylor2 at gmail.com> wrote:
>
> So that would explain why a tar.bz2 archive can't be appended to
> wouldn't it...  And also explain why winrar was so slow to open it (not
> something I mentioned before, but definitely noticed).  I had wondered
> what it was that made bz2 so much better at compression than zip and
> rar.  Not really on topic anymore but what's the method for tar.gz? And
> even more off the topic, does anyone know a good lossless compression
> method for images (mainly .jpg and .png)?
>
> Cheers,
> Jordan
>
>
> Wolfgang Draxinger wrote:
> > Jordan wrote:
> >
> > > When using python to create a tar.bz2 archive, and then using
> > > winrar to open the archive, it can't tell what the compressed
> > > size of each
> > > individual file in the archive is.  Is this an issue with
> > > winrar or is there something that needs to be set when making
> > > the archive that isn't there by default.
> >
> > When compressing a tar archive all files in the archive are
> > compressed as a whole, i.e. you can only specify a compression
> > ration for the whole archive and not just for a single file.
> >
> > Technically a tar.bz2 is actually a aggregation of multiple files
> > into a single tar file, which is then compressed.
> >
> > This is different to e.g. PKZip in which each file is compressed
> > individually and the compressed files are then merged into an
> > archive.
> >
> > The first method has better compression ratio, since redundancies
> > among files are compressed, too, whereas the latter is better if
> > you need random access to the individual files.
> >
> > Wolfgang Draxinger
> > --
> > E-Mail address works, Jabber: hexarith at jabber.org, ICQ: 134682867
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20061212/2d2e3c3f/attachment.html>


More information about the Python-list mailing list