Skip to content

Zip package created on Windows will generate messy up files after unpack on MacOS  #242

@ikey4u

Description

@ikey4u

Describe the bug

Zip a directory to create a zip package on Windows will not unzip correctly on MacOS, lets say you have a directory on Windows looks like:

mydir/
    +-- folder/
        +-- subfolder/
             +-- test.txt

Use this library (version 2.2) to zip mydir on Windows, and unzip it on MacOS you will get following directory:

$ unzip mydir.zip -d mydir
Archive:  mydir.zip
   skipping: folder\subfolder\test.txt  unsupported compression method 93
   creating: mydir/folder/
   creating: mydir/folder\subfolder/

$ tree mydir
mydir
├── folder
└── folder\\subfolder

To Reproduce

It is a little tedious to reproduce, but you can copy code from here to create a zip package such as:

 let d = std::path::Path::new(r#"D:\mydir"#);
 let b = snippet::zip::pack(&d)?;
 let mut f = File::create("mydir.zip")?;
 f.write_all(&b)?;

Then you can test the created mydir.zip.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions