There is an unsaved comment in progress. You will lose your changes if you continue. Are you sure you want to reopen the work item?
File handles persist after calling Dispose() when extracting spanned ZIP
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 and then extract 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.