• @gandalf_der_12te@discuss.tchncs.de
    link
    fedilink
    65
    edit-2
    6 days ago

    zip is better than tar.gz for some applications though.

    notably, individual files can be read from a zip archive without unpacking the whole archive, different than tar.gz files.

    tar.gz files are only better if you pack and unpack the whole archive at once, but even then, they don’t have much advantage. the major advantage is that you can pipe the output of tar creation over the network to another computer who decompresses the tar immediately, thus transferring a folder. zip has index at beginning/start, so it requires seek when writing or skip when reading, so it can’t be streamed.

    • piefood
      link
      fedilink
      English
      145 days ago

      One thing that I find useful is that you can do --filesync with an existing zip, which means it only updates the files if the date/size don’t match. This saves a bunch of time on large archives that don’t need to be created from scratch every time.

    • Ziglin (it/they)
      link
      fedilink
      English
      105 days ago

      But afaik with many files in an archive a tar.gz manages higher compression ratios since each file isn’t compressed individually. It probably isn’t relevant unless archiving a large amount of data though.

      Does .zip have other advantages though? I don’t often need just one file from an archive anyway.