User Tools

Site Tools


docs:tips_n_tricks:max_os_x:zip.html

Zip

Using pipes

I am not sure, wether this is a OS X, BSD or even more general finding. The problem occurs if you follow the samples in the manpage to create zips with pipes

tar -cf - . | zip backup -

and extract them accoringly:

unzip backup - | tar -xf -

This will not work. The reason is - as stated in the man page as well - that zip switches to Zip64 mode which is suited for large files as on a pipe the file size is not known in advance. And obviously unzip can't handle that format. There are two solutions to this:

  1. Pack with -fz-
    tar -cv - * .* | zip backup.zip -fz- -
  2. Unpack with funzip:
    funzip backup.zip | tar -xf -

According to the man page, gunzip should work too, but neither the builtin gunzip from OS X 10.6.x nor the gunzip from MacPorts recognized the format.

OSX zip

,
docs/tips_n_tricks/max_os_x/zip.html.txt · Last modified: 30.06.2021 00:22 CEST by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki