8000 minizip.exe: zip archive with empty directory? · Issue #257 · zlib-ng/minizip-ng · GitHub
[go: up one dir, main page]

Skip to content

minizip.exe: zip archive with empty directory? #257

Closed

Description

@tumagonx

I try this command :
minizip -1 ..\package.zip *
in current directory there are some empty folders but these is not added into archive.

OS: Windows

Activity

  1. nmoinvaz commented on May 1, 2018

    @nmoinvaz
    Member

    I added support for this into the dev branch.

  2. tumagonx commented on May 2, 2018

    @tumagonx
    Author

    I try:
    minizip -1 -i ..\package.zip *
    but the empty folders now added as normal zero-byte file not directory?
    am I missing something?

  3. nmoinvaz commented on May 2, 2018

    @nmoinvaz
    Member

    The directory file attribute has been set for those entries in the zip file. If you are using -l I have added attributes column so you can see it.

  4. tumagonx commented on May 2, 2018

    @tumagonx
    Author

    if I list it:
    minizip -l ..\package.zip
    I get:

    Minizip 2.2.9 - https://github.com/nmoinvaz/minizip
    ---------------------------------------------------
      Length  Method     Size Ratio   Date    Time   CRC-32     Name
      ------  ------     ---- -----   ----    ----   ------     ----
           0  Defl:F        2   0%  05-02-18  14:50  00000000   new
        2271  Defl:F      985  43%  10-03-05  05:43  9cdc5b1c   readme.txt
           0  Defl:F        2  43%  05-02-18  14:49  00000000   save
           0  Defl:F        2  43%  05-02-18  14:53  00000000   template
     5844049  Defl:F  5805063  99%  09-28-17  04:51  e4b664c4   template/201709.jpg
    

    supposedly "new" and "save" are empty directories not a file.
    this package.zip also impossible to extract due it is illegal for Windows to have directory and file of the same name "template"

    please reopen.

  5. nmoinvaz commented on May 2, 2018

    @nmoinvaz
    Member

    I don't think you are using the latest version from the dev branch. It has an attributes column.

  6. tumagonx commented on May 2, 2018

    @tumagonx
    Author

    I did use dev branch just missed the printout commit (83bce6e)
    The problem still there:

    Minizip 2.2.9 - https://github.com/nmoinvaz/minizip
    ---------------------------------------------------
      Length  Method     Size  Attribs Ratio   Date    Time   CRC-32     Name
      ------  ------     ----  ------- -----   ----    ----   ------     ----
           0  Defl:F        2     2010   0%  05-02-18  14:50  00000000   new
        2271  Defl:F      985     2020  43%  10-03-05  05:43  9cdc5b1c   readme.txt
           0  Defl:F        2     2010  43%  05-02-18  14:49  00000000   save
           0  Defl:F        2     2010  43%  05-02-18  14:53  00000000   template
     5844049  Defl:F  5805063     2020  99%  09-28-17  04:51  e4b664c4   template/20
    1709.jpg
    
  7. added a commit that references this issue on May 2, 2018
  8. nmoinvaz commented on May 2, 2018

    @nmoinvaz
    Member

    I have changed it so it shows a slash at the end if it is a directory. If you still have problems can you explain how you are seeing those directories as files and also attach your zip. Thanks.

  9. tumagonx commented on May 2, 2018

    @tumagonx
    Author

    It is still treated as file, here the zip file (I replaced sensitive data with dummy text)
    package.zip

    Googling around I notice same problem also happen to older .NET sharpziplib
    https://stackoverflow.com/questions/18363187/how-do-you-add-a-folder-to-a-zip-archive-with-icsharpcode-sharpziplib
    https://sourceforge.net/p/sevenzip/discussion/45798/thread/b246352d/

  10. tumagonx commented on May 2, 2018

    @tumagonx
    Author

    Opening the zip with hex editor it doesn't have slash at the end in the zip index. So there is mis-detection of directory? 7zip created zip does have slash

  11. nmoinvaz commented on May 2, 2018

    @nmoinvaz
    Member

    Okay I have appended a slash to the filename for directories.

  12. tumagonx commented on May 2, 2018

    @tumagonx
    Author

    cool, works now!
    tested with miniz 1.1.5 too.

  13. added
    cmdCommand line tools
    fixedIssue or bug has been fixed
    on Apr 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    cmdCommand line toolsfixedIssue or bug has been fixed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0