Pages

Monday, September 10, 2007

*nix: Workaround to cannot find zipfile directory in one of file.zip or file.zip.zip ..

Symptom:

You are trying to extract the archived files off of a huge (any file with size > 2 GB or 4GB, depending on the OS) ZIP file with unzip utility on Solaris, and it fails with the following error:
cannot find zipfile directory in one of file.zip or
file.zip.zip, and cannot find file.zip.ZIP, period.

% ls -lh file.zip
-rw-r--r-- 1 oracle dba 13G Sep 8 09:46 file.zip

zipinfo returns the following message:

$ zipinfo file.zip
[file.zip]
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
zipinfo: cannot find zipfile directory in one of file.zip or
file.zip.zip, and cannot find file.zip.ZIP, period.


Workaround:

Try extracting the files with jar tool that comes with the Java Development Kit (JDK). It may work.

Although I'm not sure, I think the 32-bit version of unzip (there's no 64-bit version) cannot handle large files of size > 2GB or 4GB. I believe the 32-bit jar tool was built with switches like -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 to overcome limitations like the one discussed in this blog entry.
______________
| | |

1 comment:

  1. Today I woke up and first of all opened my OE and received new emails. I was amazed,reason of one of them were damaged,exacter zip file inside. Fortunately I found the Internet a next program - repair damaged zip file. It helped me quite fast and for free as I keep in mind. Moreover I advised it my friend and he thanked me a lot...

    ReplyDelete