Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Can't unzip 6 GB file: bad zipfile offset

I need to unzip a file of about 6 GB. However, I can’t do it neither right-clicking (it gives an error saying "empty archive") or in the terminal, showing the following for the latter:

$ ls
 fhs-3.0.pdf   IDrive   Tese.zip  'Transport Studies of Dual-Gated ABC and ABA Trilayer Graphene: Band Gap Opening and Band Structure Tuning in Very Large Perpendicular Electric Fields - Zou.pdf'

$ unzip Tese.zip
Archive:  Tese.zip
warning [Tese.zip]:  4294967296 extra bytes at beginning or within zipfile
  (attempting to process anyway)
file #1:  bad zipfile offset (local header sig):  4294967296
  (attempting to re-compensate)
 extracting: Tese/.DS_Store          
error: not enough memory for bomb detection

$ jar xvf Tese.zip
java.util.zip.ZipException: only DEFLATED entries can have EXT descriptor
    at java.base/java.util.zip.ZipInputStream.readLOC(ZipInputStream.java:313)
    at java.base/java.util.zip.ZipInputStream.getNextEntry(ZipInputStream.java:125)
    at jdk.jartool/sun.tools.jar.Main.extract(Main.java:1361)
    at jdk.jartool/sun.tools.jar.Main.run(Main.java:409)
    at jdk.jartool/sun.tools.jar.Main.main(Main.java:1681)

I don’t think the file is corrupt because I unzipped the same file in a Mac recently.

My PC has 15 GB of RAM and 2 GB of swap memory.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Both tools, unzip and jar, explicitly told you that the file is corrupt:

miguel@...$ unzip Tese.zip
...
warning [Tese.zip]:  4294967296 extra bytes at beginning or within zipfile
  (attempting to process anyway)
file #1:  bad zipfile offset (local header sig):  4294967296
  (attempting to re-compensate)
miguel@...$ jar xvf Tese.zip
java.util.zip.ZipException: only DEFLATED entries can have EXT 
...

If you could unzip it on a Mac, it might be possible that some Mac software created that ZIP file, but maybe in a nonstandard format (as far as ZIP file standardization goes) that only some Mac software can understand.

You could try to go to that Mac again, unzip it there and then create a compressed tar file from it, then take that tar file to your PC and unpack it.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading