2

I just read this question

How to unzip split files on OS X

and it seemed straightforward enough, until I tried it.

To create and split a zip archive I used

$ zip -s 13 BW.pdf.zip BW.pdf 

which created a bunch of files,

BW.pdf.zip
BW.pdf.z01
BW.pdf.z02

(z03, z04 and so on)

Note that the first file's suffix is different from the others. That file is also just 54 kB while the other files, except for the last, are 13 MB.

I then cat:ed the resulting files, like it is suggested in the linked answer

ca BW.pdf.z* > a.zip

Finally I unzipped a.zip but then I received a lot of warnings and errors

$ unzip a.zip 
Archive:  a.zip
warning [a.zip]:  zipfile claims to be last disk of a multi-part archive;
  attempting to process anyway, assuming all parts have been concatenated
  together in order.  Expect "errors" and warnings...true multi-part support
  doesn't exist yet (coming soon).
warning [a.zip]:  125829120 extra bytes at beginning or within zipfile
  (attempting to process anyway)
file #1:  bad zipfile offset (local header sig):  125829124
  (attempting to re-compensate)
  inflating: BW.pdf
  1. What is going on here?

  2. Should the .zip-file be the first or last file in a.zip when cat:ing?

  3. What do these error messages actually mean?

  4. What is the purpose of the 54 kB .zip-file? It is not like I can feed it into unzip and unzip merges and extract the whole archive automagically.

  5. What is the difference between zip's built in split and the regular command line command (sic!) split?

  6. Are there any alternatives to zip that are better on keeping track of split archives using checksums and similar?

Uppdate:

$ zip --version
Copyright (c) 1990-2008 Info-ZIP - Type 'zip "-L"' for software license.
This is Zip 3.0 (July 5th 2008), by Info-ZIP.
Currently maintained by E. Gordon.  Please send bug reports to
the authors using the web page at www.info-zip.org; see README for details.

Latest sources and executables are at ftp://ftp.info-zip.org/pub/infozip,
as of above date; see http://www.info-zip.org/ for other sites.

Compiled with gcc 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31) for Unix (Mac OS X) on Oct  6 2017.
d-b
  • 636
  • 1
  • 6
  • 24
  • Normally you just open the `BW.pdf.zip` file and the rest is automatic, but I don't use your zip app. – harrymc Sep 01 '18 at 16:01
  • 1
    I think the problem is that `bash` expands `*.zip` in lexicographic order, so `.zip` comes at the end, after the numeric segments. Try `cat BW.pdf.zip BW.pdf.z[0-9]* > a.zip`, provided there are no more than 99 numeric segments. – AFH Sep 01 '18 at 16:07
  • I manually tried to cat bw.zip first and last into a.zip and it should be last. When it was first nothing worked, when it was last I got the same error message as the one included in the questions. – d-b Sep 01 '18 at 16:42
  • [This answer](https://unix.stackexchange.com/a/40565/108618) may still be valid. Manuals on my Kubuntu and Debian still state that "Multi-part archives are not yet supported, except…" I don't know if it's the same in Mac OS X. – Kamil Maciorowski Sep 01 '18 at 16:51

0 Answers0