I need to distribute a large (6GB+) file cross-platform. For practical reasons, I want to zip it down to 2GB+. I originally used Mac OS 10.11 to create the zip file using the Archive Utility. It extracted fine on my Linux but wouldn't extract on Windows 10 (using the system utility). When compressing the original file on Linux, I can extract it on Windows 10 but it fails to extract on Mac OS X. When I try to extract it using the command line program unzip on Mac OS X, I get the following error:

Archive:  UbuntuLTS.vdi.zip
warning [UbuntuLTS.vdi.zip]:  76 extra bytes at beginning or within zipfile
  (attempting to process anyway)
error [UbuntuLTS.vdi.zip]:  reported length of central directory is
  -76 bytes too long (Atari STZip zipfile?  J.H.Holm ZIPSPLIT 1.1
  zipfile?).  Compensating...
   skipping: UbuntuLTS.vdi           need PK compat. v4.5 (can do v2.1)

note:  didn't find end-of-central-dir signature at end of central dir.
  (please check that you have transferred or created the zipfile in the
  appropriate BINARY mode and that you have compiled UnZip properly)

The Mac is running zip 3.0 (July 5th, 2008) and unzip 5.52 (28 February, 2005). The Linux is running zip 3.0 (July 5th, 2008) and unzip 6.00 (20 April, 2009). No idea what Windows is using. I need the zip to properly extract on Mac OS X, Linux, and Windows (7, 8, 8.1, and 10). I would like to avoid telling people to download a third-party program. I would also like to understand what the heck is going on. I never had trouble with the zip format being incompatible on different platforms.

For any solution you propose, out-of-the-box post-Windows Vista is a must as those will be the biggest target group. I'm aware that asking for it to work on "Linux" is a little ill-defined.

  • You are not creating a self-extracting zip archive but just an ordinary zip archive? Do you use 64bit versions of zip? Maybe superuser.com/q/394905/504096 answers your question this text (en.wikipedia.org/wiki/Zip_%28file_format%29#ZIP64) helps you? Originally, the zip standard allowed only 4 GB to be compressed (not the size of the resulting archive file). – daniel.neumann Mar 29 '16 at 10:24
  • I was not aware of the size limitation. It seems then, the culprit is Mac OS X not supporting ZIP64 unzipping. From the Wikipedia reference you provided, I'd infer that all post-XP Windows releases have ZIP64 support. For OS X users I might have to provide an alternative .tar.gz download. Great job, Apple. – Jonas Greitemann Mar 29 '16 at 10:56
  • Apparently, version 6.0 of unzip for Mac support larger files (unix.stackexchange.com/a/220054, macupdate.com/app/mac/35967/unzip). Here are some further hints on how to obtain the version 6.0: apple.stackexchange.com/q/149080 . Is this worth an answer to your question? – daniel.neumann Mar 29 '16 at 11:52
  • If you want to go through the trouble of reposting this as an answer, I'll gladly accept it. Unfortunately, I cannot assume my audience is able to install something via homebrew, so I will stick to a separate tar.gz. – Jonas Greitemann Mar 29 '16 at 11:56
  • There is a Mac version of the Windows program 7zip available. Maybe it is possible for your audience to install it. Thanks for accepting the answer. – daniel.neumann Mar 29 '16 at 12:23

unzip version prior to version 6.0 do not support extracting zip files which are larger than 4 Gb as uncompressed files (or 2 Gb, http://www.info-zip.org/FAQ.html#limits). See for example https://superuser.com/a/394915/504096 and https://unix.stackexchange.com/a/220054 .

Unfortunately, the standard version of unzip provided by MacOS is not 6.0 but 5.X. Version 6.0 for MacOS can be obtained here: http://www.macupdate.com/app/mac/35967/unzip . This article describes how to install version 6: https://apple.stackexchange.com/q/149080

Additionally, unzip needs to be compiled with the options LARGE_FILE_SUPPORT and ZIP64_SUPPORT in order to be able to process files above 2 Gb / 4 Gb. Commonly, this should be the case. To find out, whether unzip was compiled accordingly, type unzip -version. There should be something like this in the output:

UnZip 6.00 of 20 April 2009 ...
UnZip special compilation options:
LARGE_FILE_SUPPORT (large files over 2 GiB supported)
ZIP64_SUPPORT (archives using Zip64 for large files supported)

An alternative to unzip was to use 7zip which is unofficially available for non-Windows operating systems - like MacOS (named 7zX).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.