• @[email protected]
    link
    fedilink
    956 months ago

    Zip makes different tradeoffs. Its compression is basically the same as gz, but you wouldn’t know it from the file sizes.

    Tar archives everything together, then compresses. The advantage is that there are more patterns available across all the files, so it can be compressed a lot more.

    Zip compresses individual files, then archives. The individual files aren’t going to be compressed as much because they aren’t handling patterns between files. The advantages are that an error early in the file won’t propagate to all the other files after it, and you can read a file in the middle without decompressing everything before it.

    • @herrvogel
      link
      136 months ago

      Yeah that’s a rather important point that’s conveniently left out too often. I routinely extract individual files out of large archives. Pretty easy and quick with zip, painfully slow and inefficient with (most) tarballs.

    • @QuaternionsRock
      link
      36 months ago

      Can you evaluate the directory tree of a tar without decompressing? Not sure if gzip/bzip2 preserve that.

    • fmstrat
      link
      fedilink
      1
      edit-2
      6 months ago

      Nowhere in here do you cover bzip, the subject of this meme. And tar does not compress.

      • @[email protected]
        link
        fedilink
        76 months ago

        It’s just a different layer of compression. Better than gzip generally, but the tradeoffs are exactly the same.

        • fmstrat
          link
          fedilink
          26 months ago

          Well, yes. But your original comment has inaccuracies due to those 2 points.

  • @renzev
    link
    876 months ago

    Obligatory shilling for unar, I love that little fucker so much

    • Single command to handle uncompressing nearly all formats.
    • No obscure flags to remember, just unar <yourfile>
    • Makes sure output is always contained in a directory
    • Correctly handles weird japanese zip files with SHIFT-JIS filename encoding, even when standard unzip doesn’t
    • @sh__
      link
      66 months ago

      What weird Japanese zip files are you handling?

      • @renzev
        link
        English
        8
        edit-2
        6 months ago

        Voicebanks for Utau (free (as in beer, iirc) clone of Vocaloid) are primarily distributed as SHIFT-JIS encoded zips. For example, try downloading Yufu Sekka’s voicebank: http://sekkayufu.web.fc2.com/ . If I try to unzip the “full set” zip, it produces a folder called РсЙ╠ГЖГtТPУ╞Й╣ГtГЛГZГbГgБi111025Бj. But unar detects the encoding and properly extracts it as 雪歌ユフ単独音フルセット(111025). I’m sure there’s some flag you can pass to unzip to specify the encoding, but I like having unar handle it for me automatically.

        • @sh__
          link
          46 months ago

          Ah, that’s pretty cool. I’m not sure I know of that program. I do know a little vocaloid though, but I only really listen to 稲葉曇(Inabakumori).