title: Zip files corrupt over 4 gigabytes - No warnings or errors - Did I lose my data?
body: <p>I created a bunch of zip files on my computer (Mac OS X) using a command like this:</p>
  <pre><code>zip -r bigdirectory.zip bigdirectory
  </code></pre>
  <p>Then, I saved these zip files somewhere and deleted the original directories.</p>
  <p>Now, when I try to extract the zip files, I get this kind of error:</p>
  <pre><code>$ unzip -l bigdirectory.zip
  Archive:  bigdirectory.zip
  warning [bigdirectory.zip]:  5162376229 extra bytes at beginning or within zipfile
    (attempting to process anyway)
  error [bigdirectory.zip]:  start of central directory not found;
    zipfile corrupt.
    (please check that you have transferred or created the zipfile in the
    appropriate BINARY mode and that you have compiled UnZip properly)
  </code></pre>
  <p>I have since discovered that this could be because zip can't handle files over a certain size, maybe 4 gigs. At least I read that somewhere.</p>
  <p>But why would the zip command let me create these files? The zip file in question is 9457464293 bytes and it let me make many more like this with absolutely no errors.</p>
  <p>So clearly it can create these files.</p>
  <p>I really hope my files aren't lost.  I've learned my lesson and in the future I will check my archives before deleting the original files, and I'll probably also use another file format like tar/gzip.</p>
  <p>For now though, what can I do?  I really need my files.</p>
  <h3>Update</h3>
  <p>Some people have suggested that my <code>unzip</code> tool did not support big enough files (which is weird, because I used the builtin OS X <code>zip</code> and <code>unzip</code>).  At any rate, I installed a new <code>unzip</code> from <code>homebrew</code>, and lo and behold, I do get a different error now:</p>
  <pre><code>$ unzip -t bigdirectory.zip
  testing: bigdirectory/1.JPG   OK
  testing: bigdirectory/2.JPG   OK
  testing: bigdiretoryy/3.JPG   OK
  testing: bigdirectory/4.JPG   OK
  :
  :
  file #289:  bad zipfile offset (local header sig):  4294967295
    (attempting to re-compensate)
  file #289:  bad zipfile offset (local header sig):  4294967295
  file #290:  bad zipfile offset (local header sig):  9457343448
  file #291:  bad zipfile offset (local header sig):  9457343448
  file #292:  bad zipfile offset (local header sig):  9457343448
  file #293:  bad zipfile offset (local header sig):  9457343448
  :
  :
  </code></pre>
  <p>This is really worrisome because I need these files back. And there were definitely no errors upon creation of this zip file using the system <code>zip</code> tool. In fact, I made several of these at the same time and now they are all exhibiting the same problem.</p>
  <p>If the file really is corrupt, how do I fix it?</p>
  <p>Or, if it is not corrupt, how do I extract it?</p>