Has zip any advantages over bz2?

3

Possible Duplicate:
How can I evaluate the best choice of archive format for compressing files?

I've just downloaded phpBB3 and saw they offer a bz2 (1.51 MB) and a zip (2.35 MB) download. This is the reason why I want to know if the ZIP file format has any advantages over bzip2.

According to the Wikipedia article, the zip-files can be compressed using the bzip2-compression algorithm. Why is the zip-file then that much bigger?

Martin Thoma

Posted 2011-08-31T09:52:12.247

Reputation: 2 705

Question was closed 2011-08-31T10:18:20.300

Answers

2

.zip files can contain more than one file.

.bz2 can just contain one file. The .bz2 header is more compact and it does solid compression by design.

tar is usually used to put more than one file into a .bz2 archive. This is why you often see .tar.bz2 files.

Jens Mühlenhoff

Posted 2011-08-31T09:52:12.247

Reputation: 347

2

Not relevant to the merits of one algorithm over the other, but a practical point for ZIP is support on Windows: since XP, there is ZIP support out-of-the-box, but you need external tools (e.g. 7-zip) to work with bzip2.

Piskvor left the building

Posted 2011-08-31T09:52:12.247

Reputation: 2 277

2

I want to know if the ZIP file format has any advantages over bzip2.

More people have software that can handle the zip format then a tar.bz2 file.

Zip-files can be compressed using the bzip2-compression algorithm. Why is the zip-file then that much bigger?

"Can" doesn't mean "always will be".

Quentin

Posted 2011-08-31T09:52:12.247

Reputation: 1 191

+1 "Can" doesn't mean "always will be": And in this case, that would be counter-productive, since the zip file only exists for the benefit of people without bzip decompression software. – Thilo – 2011-08-31T10:12:51.883

1More to the point: .zip files with compression other than DEFLATE are not universial. – Jens Mühlenhoff – 2011-08-31T10:20:26.257

0

In general, they support tar.gz (or bz) for linux users, and zip for windows users - most linux systems have support for the former by default, and every modern version of windows has zip.

Most zip files use deflate rather than bzip for compatability reasons, and as such the files are a little larger. In practical use though, the difference isn't really that significant.

Journeyman Geek

Posted 2011-08-31T09:52:12.247

Reputation: 119 122