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

Can't Use Embedded ZIP File #4

Closed
eXpl0it3r opened this issue Feb 13, 2023 · 5 comments
Closed

Can't Use Embedded ZIP File #4

eXpl0it3r opened this issue Feb 13, 2023 · 5 comments

Comments

@eXpl0it3r
Copy link

Switching from SharpZipLib to ZipArchive made it a requirement for NetZipArchiveFileSystem that the Stream is not only readable (and seekable), but also writeable, which doesn't work when you take the stream of a read-only embedded resource file.

Would there be a possibility to add support to read-only ZIP files as well?

I'd guess that having an additional function OpenReadOnly(Stream s) which then opens the file with ZipArchiveMode.Read should be enough. Maybe add an additional check to the write methods to throw an exception in ReadOnly mode.

@b3b00
Copy link
Owner

b3b00 commented Feb 13, 2023

@eXpl0it3r I'm quite busy these days. Could you try your solution and propose a pull request ? I will be happy to merge it, if you succeed. Don't forget a minimal unit test.

b3b00 added a commit that referenced this issue Feb 13, 2023
@b3b00
Copy link
Owner

b3b00 commented Feb 13, 2023

@eXpl0it3r I've just published a new nuget version (1.0.7) with your PR. I let you close this issue

@eXpl0it3r
Copy link
Author

eXpl0it3r commented Feb 13, 2023

Oh awesome, that was quick, thanks a lot! 🙂
I'd be happy to add some tests as well, but first wanted to enable CI for PRs as well, which I just PR-ed with #6

I'll write a test and check that the implementation fully works, afterwards close the issue.

@b3b00
Copy link
Owner

b3b00 commented Feb 13, 2023

thanks for you PR #6 , I've just merge it.

@eXpl0it3r
Copy link
Author

Thanks again for your quick response! 🙂

As mentioned in #7, you may want to publish a new NuGet package, since I broke the standard NetZipArchiveFileSystem, as it will throw when trying to open an entry as ReadWrite, but I'll close this issue.

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

No branches or pull requests

2 participants