Skip to content

minizip Example: Compressed text file is decompressed as empty directory #355

@telkamp

Description

@telkamp

When I compress a single text file using the minizip example binary and I decompress it, an empty directory with the name of the text file is generated.

Steps for reproduction:

  1. Compressing the text file "test/lorem-ipsum.txt"
    ./minizip lorem-ipsum_1.zip test/lorem-ipsum.txt
  2. Decompressing the archive lorem-ipsum_1.zip:
./minizip -x lorem-ipsum_1.zip
Minizip 2.8.1 - https://github.com/nmoinvaz/minizip
---------------------------------------------------
-x lorem-ipsum_1.zip
Archive lorem-ipsum_1.zip
Extracting lorem-ipsum.txt
Error -111 saving zip entries to disk lorem-ipsum_1.zip

Listing the content using the -l option seems to be ok:

./minizip -l lorem-ipsum_1.zip
Minizip 2.8.1 - https://github.com/nmoinvaz/minizip
---------------------------------------------------
-l lorem-ipsum_1.zip
      Packed     Unpacked Ratio Method   Attribs Date     Time  CRC-32     Name
      ------     -------- ----- ------   ------- ----     ----  ------     ----
         625         3977   15% Defl:N  81a40080 01-06-19 12:37 cdae061d   lorem-ipsum.txt

But also unzip is unable to decompress the archive - no files are extracted:

unzip lorem-ipsum.zip
Archive:  lorem-ipsum.zip
unzip: zip flags 1 and 8 are not supported

I'm using minizip on an embedded ARM Cortex A9 platform running Linux 4.9.88.

Please find attached the text file lorem-ipsum.txt and the faulty zip file lorem-ipsum_1.zip.
lorem-ipsum.txt
lorem-ipsum_1.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    fixedIssue or bug has been fixed

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions