PDA

View Full Version : Dealing with bzip2 compressed tar files



momesana
21st September 2007, 23:04
Hi,
I would like to have bzipped tarballs that are read by the appilcation without the need for extracting them. The Idea behind this is that I want to achieve a means for easily changing the applictions theme. The theme should be a simple tarball compressed in bzip|gzip with an xml-file that contains information about the theme (author, inlcuded files, creation date ...), preview-images and last but not least the css file itself. The information should then be extracted on the fly and shown to the user. Right now I am reading libbzip2's documentation. AFAIK Bzip2 only operates on files and not directories so I assume I would end up with a tarball after decompressing. If there is another/simpler (and portable since the app is supposed to run on all platforms supported by Qt ...) way to do this
(for example using zip) I would most probably do that. Any Ideas?

Thanx

wysota
25th September 2007, 11:56
You can use libbzip2 to decompress the archive and then either untar it manually (tar simply concatenates files probably adding some headers) or use a library that can untar. There is nothing unportable here - I'm sure libbzip2 is available on many platforms. libzip is also an option, but it won't decompress bz2 files, only zips (and again you have to have the library on all platforms you want to support).