If I create a zip file that contain zero size files,the Windows 10 Explorer build-in zip viewer can't uncompress it. #186

Closed
opened 2026-01-29 22:07:57 +00:00 by claunia · 8 comments
Owner

Originally created by @yinyue200 on GitHub (May 30, 2017).

English is not my native language; please excuse typing errors.
Thanks

Originally created by @yinyue200 on GitHub (May 30, 2017). English is not my native language; please excuse typing errors. Thanks
Author
Owner

@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?

@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?
Author
Owner

@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.
tim 20170530214354
a.zip

@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. ![tim 20170530214354](https://cloud.githubusercontent.com/assets/13848771/26586327/6f5a3d76-4581-11e7-9110-78d7779a27a7.png) [a.zip](https://github.com/adamhathcock/sharpcompress/files/1038511/a.zip)
Author
Owner

@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.

@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.
Author
Owner

@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 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](https://github.com/adamhathcock/sharpcompress/files/1038536/a.zip)
Author
Owner

@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.

@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.
Author
Owner

@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): 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.
Author
Owner

@adamhathcock commented on GitHub (May 30, 2017):

Found a bug while reviewing this though: https://github.com/adamhathcock/sharpcompress/pull/249

@adamhathcock commented on GitHub (May 30, 2017): Found a bug while reviewing this though: https://github.com/adamhathcock/sharpcompress/pull/249
Author
Owner

@yinyue200 commented on GitHub (May 30, 2017):

@adamhathcock Thanks

@yinyue200 commented on GitHub (May 30, 2017): @adamhathcock Thanks
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#186