mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-03 21:23:38 +00:00
If Zip file has normal file header AND a post-descriptor header AND the file is attempted to be skipped by a ZipReader, then the data is attempted to be skipped twice. #210
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 @KvanTTT on GitHub (Jul 7, 2017).
Originally assigned to: @adamhathcock on GitHub.
I have the following BadStateArchive.zip.
I want to ignore files that start with the dot:
.DS_Store. But if I just ignore such file I get the exceptionBad state (invalid stored block lengths)inreader.MoveToNextEntry()method. I use the following code for reading:If such files writing to
DummyStreamexception does not occur:where
DummyStreamis@adamhathcock commented on GitHub (Jul 7, 2017):
It's probably because you're returning 0 on Read which means the stream is empty. I don't think decompression likes trying to operation on a zero byte stream.
@KvanTTT commented on GitHub (Jul 8, 2017):
But I should not use
WriteEntryTomethod for getting rid of exception.@adamhathcock commented on GitHub (Jul 8, 2017):
I don’t know offhand but I may just have a try/catch that’s hiding that exception in that extension.
@KvanTTT commented on GitHub (Jul 8, 2017):
I tried to wrap a
reader.MoveToNextEntry()to try/catch block. But in this case, not all files being processed. Although they should.@adamhathcock commented on GitHub (Jul 8, 2017):
Sorry. I finally understand what you're trying to: just skip a .DS_Store file but it isn't working. I've reproduced it.
The dummy stream stuff you mentioned doesn't have anything to do with it.