1

Closed

Save a Spanned Zip after reading an existing ZipFile

description

from http://dotnetzip.codeplex.com/discussions/264762
 
I have an existing zip file. I would like to create a copy of this but saved using spans.
 
using (var someZip = ZipFile.Read(@"c:\original.zip"))
{
  someZip.MaxOutputSegmentSize := 65536;
  someZip.Save(@"c:\somezip.zip");
}
 
 
The save works fine, but reading extracting the resulting spanned zip results in errors.
For example:
 
failed to extract entry somefile.txt -- bad state (invalid block type)
Ionic.Zlib.ZlibException: Bad state (too many length or distance symbols)
 
Ionic.Zlib.ZlibException: Bad state (oversubscribed dynamic bit lengths tree)
 
System.IO.IOException: An attempt was made to move the file pointer before the beginning of the file.
 
etc
 
Looks like corrupted data.
 
I suspect this is because DotNetZip is simply copying the zipentry in its entirety, without re-calculating the offsets or the disknumbers.
Closed Jul 14, 2011 at 12:45 AM by Cheeso
fixed in changeset 80668. The first binary that will contain this fix is v1.9.1.6.

comments