mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-08 13:34:57 +00:00
If I create a zip file that contain zero size files,the Windows 10 Explorer build-in zip viewer can't uncompress it. #186
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 @yinyue200 on GitHub (May 30, 2017).
English is not my native language; please excuse typing errors.
Thanks
@adamhathcock commented on GitHub (May 30, 2017):
Couple questions: does anything else open it? Maybe Windows 10 just doesn't like zero byte files.
Can you show me your code?
@yinyue200 commented on GitHub (May 30, 2017):
@adamhathcock 7zip can open it.
sample code:https://github.com/yinyue200/sharpcompressdemo
Here is the error message.The screenshot is created by the Chinese version of Windows 10, but I hope it can be useful.

a.zip
@adamhathcock commented on GitHub (May 30, 2017):
If you create a file like this with a zero byte entry in another application, can Windows 10 open that?
I'm saying it might be a failing (or security check) for Windows 10.
@yinyue200 commented on GitHub (May 30, 2017):
@adamhathcock I can create a zip file that contain zero size file by 7zip. And it can be opened by Windows 10. Here is the file.
a.zip
@yinyue200 commented on GitHub (May 30, 2017):
@adamhathcock Sharpziplib can't open the file that created by sharpcompress and contain zero file too
I hope it can help you.
@adamhathcock commented on GitHub (May 30, 2017):
I think it's because the entry is still marked as compressed even though it's zero bytes. The 7Zip created file you gave has the entry marked as CompressionMethod = None.
I guess that's the difference. I don't want to make SharpCompress smart enough to recognize that. That's a user responsibility I think.
@adamhathcock commented on GitHub (May 30, 2017):
Found a bug while reviewing this though: https://github.com/adamhathcock/sharpcompress/pull/249
@yinyue200 commented on GitHub (May 30, 2017):
@adamhathcock Thanks