Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.3.0: ZipArchive::extract newly expects the destination dir exists #314

Closed
marxin opened this issue Mar 17, 2025 · 2 comments
Closed

2.3.0: ZipArchive::extract newly expects the destination dir exists #314

marxin opened this issue Mar 17, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@marxin
Copy link

marxin commented Mar 17, 2025

Describe the bug
The following code snippet stopped working with update to 2.3.0 if the directory does not exist:

 let path = r"C:\Users\martinlika\Downloads\sample.zip";
    ZipArchive::new(File::open(path).unwrap())
        .unwrap()
        .extract(r"C:\Users\martinlika\Downloads\folder_xyz")
        .unwrap();

Fails with:

     Running `target\debug\zip-demo.exe`
thread 'main' panicked at src\main.rs:10:10:
called `Result::unwrap()` on an `Err` value: Io(Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." })
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: process didn't exit successfully: `target\debug\zip-demo.exe` (exit code: 101)

Looking at the documentation of the function, there is no requirement mentioned about the existence of the directory.

@marxin marxin added the bug Something isn't working label Mar 17, 2025
Pr0methean added a commit that referenced this issue Mar 17, 2025

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
@Pr0methean
Copy link
Member

Fixed in 2.4.1.

@marxin
Copy link
Author

marxin commented Mar 18, 2025

Thanks for the quick fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants