DotNetZip.Semverd icon indicating copy to clipboard operation
DotNetZip.Semverd copied to clipboard

"overflow while creating filename" issue with large zip file

Open MartinDWhite opened this issue 8 years ago • 2 comments

I have a large zip file (4.7Gb) with lots of files (13,843) contained in it. When opening this zip file from DotNetZip with this code:

using (ZipFile zip = ZipFile.Read(zipFilePath)) { foreach (ZipEntry entry in zip.Entries) {...snip...} }

There was the exception "overflow while creating filename". I tracked this down to the lines inZipDirEntry.cs (129 to 133)

internal static string AppendCopyToFileName(string f) { callCount++; if (callCount > 25) throw new OverflowException("overflow while creating filename"); ...snip...

I changed the 25 to 1000 and the file opened and processed as expected. Why is call count checked against 25? Is it falsely detecting an error?

MartinDWhite avatar Aug 03 '17 12:08 MartinDWhite

I have no idea why that code is there. This is a repo with self-service PRs (obviously they'll be reviewed and have to have a justification)

haf avatar Aug 07 '17 07:08 haf

FWIW, that code only triggers when the zipfile contains multiple copies of files with the same pathname, which is usually a problem in the input file.

1512b4ef (merged via #75) should have fixed this for all but the most silly cases. 547a4d39 (also from #75) lets you IgnoreDuplicateFiles if you just want to ignore the duplicates instead of getting extra numbered-"copy" files.

uecasm avatar Sep 27 '19 05:09 uecasm