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 to 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.

,
docs/tips_n_tricks/max_os_x/zip.html.txt · Last modified: 19.12.2015 14:58 CET by peter