I have encountered an inconsistency between cygwin's zip and unzip programs 
that I think reflects a bug (or incomplete implementation) in unzip.

First, I am using the very latest release of cygwin 64 bit:
    $ uname -a
    CYGWIN_NT-6.1 yhbrent 1.7.32(0.274/5/3) 2014-08-13 23:06 x86_64 Cygwin
And when I installed from setup-x86_64.exe, I added the zip and unzip programs 
from the Archive section.  Running setup-x86_64.exe just now, I see that the 
version numbers of what I have installed are:
    zip: 3.0-12
    unzip: 6.0-1

The issue: zip can successfully archive large (> 4 GiB) files that unzip cannot 
extract.

Consider this cygwin shell session I just did:

    $ ls -al bigFile.txt
    -rwx------+ 1 yhbrent None 5368709120 Oct 30 18:35 bigFile.txt

    $ zip test.zip bigFile.txt
      adding: bigFile.txt (deflated 0%)

    $ mkdir ./tmp

    $ mv test.zip ./tmp/

    $ cd ./tmp/

    $ unzip test.zip
    Archive:  test.zip
    error: End-of-centdir-64 signature not where expected (prepended bytes?)
      (attempting to process anyway)
    warning [test.zip]:  1068461579 extra bytes at beginning or within zipfile
      (attempting to process anyway)
       skipping: bigFile.txt             need PK compat. v4.5 (can do v2.1)

    $ echo $?
    81

In other words, I had a big (5 GiB) file, zip successfuly archved it, but when 
I tried to unzip it, I got error output and an error exit code of 81.

I know that zip really did work in archiving that large file, because I was 
able to successfuly extract its payload using 7zip, and confirmed that the 
result was the same (diff ../bigFile.txt ./bigFile.txt printed out nothing).

Does the error output "need PK compat. v4.5" mean that unzip fails to support 
the zip64 extensions needed to handle large files?

Given that zip clearly has zip64 support, it is a big issue that you can 
archive stuff that subsequently cannot be extracted.                            
 

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Reply via email to