mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-03 21:23:38 +00:00
ExtractToDirectory has missing files when working with encrypted zip files which contain directories #698
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @aaronbarak666-art on GitHub (Aug 19, 2025).
Created an encrypted zip file using 7zip with the following structure:
The following code only extracts
a.txt:Zip files without a password, or without directories seem to work ok
Also 7z files work.
This seems to be an issue with
ExtractAllEntries, since this test case works on version0.38.0, when I useWriteToDirectoryinstead.This does break again in
0.40.0, because of #900 which madeWriteToDirectoryuseExtractAllEntries@Morilli commented on GitHub (Aug 20, 2025):
Can't reproduce on either latest master or with version
0.40.0using the same code and the following test archive: TestDirectory.zipDoes this only happen with specific zip files? Could you share an example file?
@aaronbarak666-art commented on GitHub (Aug 21, 2025):
I've tried your file and it did work.
I did manage to reproduce it again with very small text files (one character). Maybe it's connected to the compression method?
Small files are compressed in 7-zip as
AES-256 Storeinstead ofAES-256 DeflateHere's an example for a non-working zip file
TestDirectory.zip