Dec 19, 2010 at 10:11 AM
Edited Dec 19, 2010 at 11:14 PM
Thanks for this very helpful library.
Just ran into an issue when extracting spanned archives created with DotNetZip. My code is written in PowerShell.
Code to create the spanned archive:
$zipfile = new-object Ionic.Zip.ZipFile
$zipfile.UseZip64WhenSaving = [Ionic.Zip.Zip64Option]::AsNecessary
$zipfile.MaxOutputSegmentSize = $archiveSegmentSize # 40MB
Code to extract the spanned archive:
$zip = [Ionic.Zip.ZipFile]::Read($Zipfile.Fullname)
$zip.ExtractExistingFile = [Ionic.Zip.ExtractExistingFileAction]::OverwriteSilently
This will create a spanned archive with say about 5 segments. What I've noticed is that after the spanned archive is extracted, file handles to the archive segments are not closed for most of the segments after calling the Dispose() method. This means the
segment files cannot be deleted because they are still in use.
This also seems to be the case when extracting a spanned archive with the DotNetZip-WinFormsTool program.
When I tried the same code to extract a non-spanned ZIP created with DotNetZip, the file handle was closed and I could delete the ZIP file after.