jaime-olivares / zipstorer

A Pure C# Class to Store Files in Zip
MIT License
183 stars 63 forks source link

Update ZipStorer.cs #42

Closed MinusWall closed 2 years ago

MinusWall commented 3 years ago

After: using (var zipStorer = ZipStorer.Open(importPath, FileAccess.Read)) exception is thrown in Open constructor and importPath stream remains open, preventing move/deletion of it later - this fixes that

In ReadFileInfo, I've added check for zip file header 4 bytes check, for faster recognition of non zip files. I am not sure if all zip files have that, that 4 bytes I've taken from https://en.wikipedia.org/wiki/ZIP_(file_format) Local file header signature = 0x04034b50 (read as a little-endian number)

tw-JordanChen commented 2 years ago

LGTM