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

WriteEntryToDirectory not working on Linux #537

Open
JoshClose opened this issue Sep 2, 2020 · 3 comments
Open

WriteEntryToDirectory not working on Linux #537

JoshClose opened this issue Sep 2, 2020 · 3 comments

Comments

@JoshClose
Copy link

The .zip file was created on Windows. I'm not sure if that matters or not.

In ExtractionMethods.WriteEntryToDirectory the second line makes a call to Path.GetFileName(entry.Key). The key looks like "a\\b.txt". Since this is running on Linux the file name I get back is "a\\b.txt" instead of "b.txt". This is causing all the files to have names like a\b.txt instead of creating the folder structure and putting the file in it.

@JoshClose
Copy link
Author

Looks like zips created with 7zip and with Windows Send to Compressed (zipped) folder both create entries with keys using / and not \. I'll figure out how this file was created.

@JoshClose
Copy link
Author

It was created using PowerShell's Compress-Archive module. A bug was submitted that was fixed and released in PowerShell 6.2.1 and 7.0.

Would it be beneficial to try and handle invalid zip files like this?

@adamhathcock
Copy link
Owner

I don't believe it is. Slashes mean directories in zip keys. If there's an extra one, that's not the fault of the decoder. The encoder shouldn't have it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants