2

I have a zipped file (using Winrar) and the size of it is more than 4GB from Windows 10. I've already dumped the file in Unix Server and I want to unzip the file but the error always shows:

Code: unzip filename.zip

unzip: cannot find or open filename.zip, filename.zip.zip or filename.zip.ZIP.

Note that the zip file contains .csv files (more than 50 files)

Kindly help me. Thanks

8
  • When I try to trace the problem using "strace unzip filename.zip" the error was, "ERROR: unable to open /dev/log"
    – Ace
    Commented Jul 9, 2019 at 5:28
  • I try 'll filename.zip', unknown command.
    – Ace
    Commented Jul 9, 2019 at 5:35
  • 1
    try ls -l filename.zip
    – Siva
    Commented Jul 9, 2019 at 5:36
  • are you unzipping the file from a different path?please confirm your working directory and the directory your file is actually in is the same?
    – FrontENG
    Commented Jul 9, 2019 at 5:53
  • 4
    Please edit your question and add how you list the files and the output of it.
    – pLumo
    Commented Jul 9, 2019 at 8:45

2 Answers 2

1

The question asks about unzipping a file which is larger than 4Gb, that was created using Winrar.

According to some people, unzip (Info-ZIP) is not able to handle that large a file due to limitations in the zip-format, and that a multi-volume zip archive would be needed, while others mention a zip64 extension which may/may not be provided in a given copy of unzip:

Now... Info-ZIP has had support for "large files" since the release of 6.0 in April 2009, based on a description in PKWARE, e.g., quoting from Info-ZIP's proginfo/ziplimit.txt file:

A2) Hard limits of the Zip archive format with Zip64 extensions:
   In 2001, PKWARE has published version 4.5 of the Zip format specification
   (together with the release of PKZIP for Windows 4.5).  This specification
   defines new extra field blocks that allow to break the size limits of the
   standard zipfile structures.  This extended "Zip64" format enlarges the
   theoretical limits to the following values:

   Number of entries in Zip archive:            16 Ei (2^64 - 1 entries)
   Compressed size of archive entry:            16 EiByte (2^64 - 1 Bytes)
   Uncompressed size of entry:                  16 EiByte (2^64 - 1 Bytes)
   Size of single-volume Zip archive:           16 EiByte (2^64 - 1 Bytes)
   Per-volume size of multi-volume archives:    16 EiByte (2^64 - 1 Bytes)
   Number of parts for multi-volume archives:   4 Gi (2^32 - 1 parts)
   Total size of multi-volume archive:          2^96 Byte (16 Ei * 4Gi)

   The Info-ZIP software releases (beginning with Zip 3.0 and UnZip 6.0)
   support Zip64 archives on selected environments (where the underlying
   operating system capabilities are sufficient, e.g. Unix, VMS and Win32).

and one can see if it is supported:

$ unzip -v
UnZip 6.00 of 20 April 2009, by Debian. Original by Info-ZIP.

Latest sources and executables are at ftp://ftp.info-zip.org/pub/infozip/ ;
see ftp://ftp.info-zip.org/pub/infozip/UnZip.html for other sites.

Compiled with gcc 8.3.0 for Unix (Linux ELF).

UnZip special compilation options:
        ACORN_FTYPE_NFS
        COPYRIGHT_CLEAN (PKZIP 0.9x unreducing method not supported)
        SET_DIR_ATTRIB
        SYMLINKS (symbolic links supported, if RTL and file system permit)
        TIMESTAMP
        UNIXBACKUP
        USE_EF_UT_TIME
        USE_UNSHRINK (PKZIP/Zip 1.x unshrinking method supported)
        USE_DEFLATE64 (PKZIP 4.x Deflate64(tm) supported)
        UNICODE_SUPPORT [wide-chars, char coding: UTF-8] (handle UTF-8 paths)
        LARGE_FILE_SUPPORT (large files over 2 GiB supported)
        ZIP64_SUPPORT (archives using Zip64 for large files supported)
        USE_BZIP2 (PKZIP 4.6+, using bzip2 lib version 1.0.6, 6-Sept-2010)
        VMS_TEXT_CONV
        WILD_STOP_AT_DIR
        [decryption, version 2.11 of 05 Jan 2007]

UnZip and ZipInfo environment options:
           UNZIP:  [none]
        UNZIPOPT:  [none]
         ZIPINFO:  [none]
      ZIPINFOOPT:  [none]

Now... WinRAR has had support for extracting from zip64 files for some time (version 3.50 in 2005), mentioned in its release notes. But none of the subsequent releases mention zip64, and several people comment that it cannot create zip64 files. If that is correct, OP may actually have an RAR file, which would not be read correctly by unzip.

When unzip attempts to open a file which is not actually a zip-file, it gives a message, e.g.,

$ unzip -l foo.zip
Archive:  foo.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.
unzip:  cannot find zipfile directory in one of foo.zip or
        foo.zip.zip, and cannot find foo.zip.ZIP, period.

In a quick check, if it tries to open an RAR file, the message is the same.

But the file program can tell what it is:

file foo.zip
foo.zip:    RAR archive data, v5

The 7-zip program can extract an RAR file. But unzip cannot.

$ 7z l foo.zip

7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21
p7zip Version 16.02 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,64 bits,2 CPUs Intel(R) Core(TM) i7-4578U CPU @ 3.00GHz (40651),ASM,AES-NI)

Scanning the drive for archives:
1 file, 36015 bytes (36 KiB)

Listing archive: foo.zip

--
Path = foo.zip
Open WARNING: Can not open the file as [zip] archive
Type = Rar5
Physical Size = 36015
Solid = -
Blocks = 5
Encrypted = -
Multivolume = -
Volumes = 1

   Date      Time    Attr         Size   Compressed  Name
------------------- ----- ------------ ------------  ------------------------
2009-04-19 17:38:10 .....         4938         1996  funzip.1
2009-04-19 19:33:10 .....        49657        17764  unzip.1
2009-04-19 17:38:48 .....        14661         5499  unzipsfx.1
2009-04-19 17:38:52 .....         3811         1557  zipgrep.1
2009-04-19 17:39:00 .....        23607         8822  zipinfo.1
------------------- ----- ------------ ------------  ------------------------
2009-04-19 19:33:10              96674        35638  5 files

Warnings: 1
5
  • This doesn’t explain the error shown in the question, or am I missing something? Commented Feb 23, 2023 at 5:28
  • 1
    sure it does: OP probably had an RAR file, which unzip wouldn't "find". It's often the case that in bug reports the message shown is incomplete. (OP isn't currently active, or I'd dig into the report to prove that). Commented Feb 23, 2023 at 8:27
  • I don’t think it does. The OP’s error message, which appears to be copy-pasted (perhaps not in full, but that’s not significant here), says “cannot find or open …”. That only happens if the file doesn’t actually exist. As your answer shows, if they were trying to open a RAR file (even incorrectly named), the error would be different: “cannot find zipfile directory in one of …” Commented Feb 23, 2023 at 8:47
  • Reading the source code for unzip, I don't agree, since G.no_ecrec can be set either way, not only as you state. Commented Feb 23, 2023 at 9:18
  • I said that the error message shown in the question only happens if the file doesn’t exist. The error message shown in your answer is displayed if G.no_ecrec is set, yes, but that doesn’t happen if the file doesn’t exist. Commented Feb 23, 2023 at 13:50
-1

I've tried by using some jar/Java utility installed in my server

UNIX-SERVER# find /opt -name jar
/opt/java6/bin/jar
/opt/java6/bin/IA64N/jar
/opt/java6/bin/IA64W/jar
/opt/java1.5/bin/jar
/opt/java1.5/bin/IA64N/jar
/opt/java1.5/bin/IA64W/jar
/opt/java7/bin/jar
/opt/java7/bin/IA64N/jar
/opt/java7/bin/IA64W/jar
UNIX-SERVER#
UNIX-SERVER# /opt/java6/bin/jar xvf zipped_file.zip
  created: files/
  created: files/install/
extracted: files/install/addLangs.sh
 inflated: files/install/attachHome.sh
 inflated: files/install/clusterparam.ini
 inflated: files/install/detachHome.sh
 inflated: files/install/lsnodes
 inflated: files/welcome.html
UNIX-SERVER#

That works to me, I hope works for you to. Regards

For references: https://community.hpe.com/t5/System-Administration/unzip-problem-Needs-help/td-p/4161201

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .