13

7-zip gives me 5 options for the compression method to zip files with:

  • Deflate
  • Deflate64
  • LZMA
  • BZip2
  • PPMd

On my Windows 8 machine, the built-in Windows Explorer utility appears to handle LZMA with no problem can list the files in an LZMA-compressed file with no problem...but not actually read them. I know Deflate is the most compatible, but for some files I'm attempting to distribute, the maximum setting results in a file that's 2x larger than the LZMA-compressed file. However, because the people I'm distributing it to have whatever OS, I need a widely-supported format.

What compression methods to the native zip utilities on Windows 7, 8, and Mac OS X support?

Nick T
  • 2,667
  • 7
  • 32
  • 42
  • 2
    If your primary goal is compatibility with all/most OSs and unzipping tools, then Deflate is your best choice. – Ƭᴇcʜιᴇ007 Mar 27 '15 at 18:41
  • LZMA is not native to Mac or Win, but [7-zip](http://www.7-zip.org/download.html) is available for a large number of platforms. I guess it depends on whether your potential users would already have it, or if the additional download would be less than the difference between LZMA & Deflate – Tetsujin Mar 27 '15 at 18:43
  • Related/Possible dupe: [How do I make zip files that unzip cleanly on any OS with native tools?](http://superuser.com/questions/389619/how-do-i-make-zip-files-that-unzip-cleanly-on-any-os-with-native-tools?rq=1) – Ƭᴇcʜιᴇ007 Mar 27 '15 at 18:43
  • @Ƭᴇcʜιᴇ007 The posible dupe is a bit platform- & OS-specific. I'd consider this a new question, & your initial comment actually 'the answer' to it. – Tetsujin Mar 27 '15 at 18:50
  • 1
    Personally, if the file is big enough to warrant the discussion, I'd hit it with whatever gets the best compression, and provide a link to 7-zip for people who have issues with native tools. – Nate Mar 27 '15 at 19:04
  • @Nate If I'm sending something to a client at work, I absolutely need it to open on their computer first try. – Wowfunhappy Jun 06 '19 at 22:46

4 Answers4

10

If your primary goal is compatibility with all/most OSs and unzipping tools, then Deflate is your best choice.

From Wikipedia's Zip->Compression Methods article:

The most commonly used compression method is DEFLATE, which is described in IETF RFC 1951.

Ƭᴇcʜιᴇ007
  • 111,883
  • 19
  • 201
  • 268
  • 1
    Deflate, +1. Be careful of implementations, though. They adhere to RFC 1951 (Deflate) and RFC 1952 (Gzip) to varying levels. See, for example, [The Archive Browser does not honor original filename field in a GZIP header](http://code.google.com/p/theunarchiver/issues/detail?id=802). – jww Mar 27 '15 at 20:03
7

Since no one has answered the actual question yet:

What compression methods to the native zip utilities on Windows 7, 8, and Mac OS X support?

  • Windows 7+ supports Deflate and Deflate64.
  • macOS only supports Deflate.
lily wilson
  • 171
  • 1
  • 3
1

Any OS with python 3.3 or above and the zipfile, zlib, bz2 & lzma modules can unpack zip files using Deflate, Deflate64, BZip2 and LZMA compression methods using the zipfile command line interface, e.g.

python3 -m zipfile -e example.zip .

Recent versions of macOS and many (most?) Linux distros fulfil this criteria.

ruario
  • 111
  • 1
0

In 2020 it seems that still only zip + Deflate is acceptable for GUIs, but for automated processes and CLI, you've got a few other options:

Native CLI Support: tar

  • Mac ships with BSD tar
  • Linux ships with GNU tar
  • Windows 10 ships with BSD tar.exe

They all support tar.gz.

BSD tar also supports .zip (but not LZMA, unless xz is also installed, which it is not on Windows 10, as of 2020).

zip support is native on MacOS, and pretty easy to get on Linux.

Cross-Platform: arc

If it's reasonable to have someone use a utility that's easy to install and that supports xz (LZMA, same as 7z), arc is lightweight and can be installed without a platform-specific package manager - meaning no brew: bare download or via webinstall.

arc unarchive example.tar.xz

It also supports several other common formats: zip, xz, tar.xz, tar.gz, tar.bz2, etc.

coolaj86
  • 893
  • 1
  • 9
  • 19
  • The bit about `tar` etc. does not appear to clearly address the question. Also there is no standard `tar` in Windows, so such is less portable without additional tooling. – user2864740 Oct 14 '21 at 20:41
  • 1
    tar.exe (BSD Tar) has been available as part of the native Windows CLI tooling since the last update of 2017: https://techcommunity.microsoft.com/t5/containers/tar-and-curl-come-to-windows/ba-p/382409 – coolaj86 Oct 15 '21 at 22:34
  • Generically speaking tar is a form of zip in the same way that 7-zip and WinZip are a form of zip. Tar and WinZip both have a "none" option for compression, and both support other forms of compression too. – coolaj86 Oct 15 '21 at 22:36