Hacker News new | ask | show | jobs
by StavrosK 3676 days ago
Can anyone tell me what advantage tgz has over zip? I usually curse when I have to use it, because it lacks indexes and is pretty much only good for archival tapes, if that. I wish we'd all move to a more modern format, like zip or 7zip.
3 comments

afaik neither zip nor 7z store unix permissions, file ownership, symlinks and a bunch of other features.

Other than that the "modern" version of it is .tar.xz.

I believe, technically, you can store that data in a zip's metadata headers. It is just pretty much every zip/unzip implementation doesn't support it / permission restoration breaks across OSes
Zip compresses each file separately. A folder full of zip files, each containing a single file, should take up roughly the same space as a zip archive containing all of the files. tgz doesn't do this, so it has a higher compression ratio for large collections of files. However, you cannot extract a single file alone from a tgz archive. This is why zip was designed the way it was.
zip (the version used most commonly) does not support Unicode. I have a lot of zip files created by people on Windows that turn into nonsensical filenames when extracted on Linux or OS X.