[
  {
    "Id": "538987",
    "ThreadId": "239172",
    "Html": "\r\n<p>When extracting a spanned ZIP created with DotNetZip using the built-in Windows 7 windows explorer ZIP extraction right click option, sometimes I get an error:</p>\r\n<p>&nbsp;</p>\r\n<p>&quot;The same volume can not be used as both the source and destination&quot;</p>\r\n<p>&nbsp;</p>\r\n<p>It doesn't happen all the time however. Currently I am running a test program that I created to try to figure out what makes this happen. I'm not sure it it is related to the number of segments created, or the size of the segments or if it is something else.</p>\r\n<p>Once I have more info i'll post it back here.</p>\r\n<p>My test program is written to create spanned ZIPs of a large directory (100GB) with a random segment size. The issue happened on my current test run:</p>\r\n<p>&nbsp;</p>\r\n<p>Segment size: 1710869114</p>\r\n<p>Number of segments: 9</p>\r\n",
    "PostedDate": "2010-12-21T13:56:23.25-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "539119",
    "ThreadId": "239172",
    "Html": "\r\n<p>After some more testing, out of DotNetZip, WinZIP, 7zip, WinRAR and the built-in Windows 7 ZIP extraction, DotNetZip, WinZIP and WinRAR were the only software that could extract the spanned ZIP created by DotNetZip. For some reason 7zip and the Win7 built-in\r\n extraction could not do the extraction.</p>\r\n<p>&nbsp;</p>\r\n<p>Here is my testing code. It automates the creation of spanned zips. It prompts for an input directory to ZIP and an output directory to dump test runs to of varying segment sizes. The size of the span is selected randomly.</p>\r\n<p>&nbsp;</p>\r\n<p>#region<br>\r\n<br>\r\nfunction Get-ScriptDirectory<br>\r\n{&nbsp;&nbsp; <br>\r\n&nbsp;&nbsp;&nbsp; $invocation = (Get-Variable MyInvocation -Scope 1).Value<br>\r\n&nbsp;&nbsp;&nbsp; $script = [IO.FileInfo] $invocation.MyCommand.Path<br>\r\n&nbsp;&nbsp;&nbsp; if ([IO.File]::Exists($script)) {<br>\r\n&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Return (Split-Path $script.Fullname)<br>\r\n&nbsp;&nbsp;&nbsp; }<br>\r\n&nbsp;&nbsp;&nbsp; else {<br>\r\n&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return $null<br>\r\n&nbsp;&nbsp;&nbsp; }<br>\r\n}<br>\r\n<br>\r\nfunction Show-FolderBrowser <br>\r\n{<br>\r\n&nbsp;&nbsp;&nbsp; param (<br>\r\n&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [string] $Prompt = &quot;Select Directory&quot;<br>\r\n&nbsp;&nbsp;&nbsp; )<br>\r\n&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>\r\n&nbsp;&nbsp;&nbsp; [string] $SelectedFolder = (new-object -ComObject Shell.Application).BrowseForFolder(0, $Prompt, 1).Self.Path<br>\r\n&nbsp;&nbsp;&nbsp; if (!$SelectedFolder) {<br>\r\n&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return $null<br>\r\n&nbsp;&nbsp;&nbsp; }<br>\r\n&nbsp;&nbsp;&nbsp; if ([IO.Directory]::Exists($SelectedFolder)) {<br>\r\n&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return [IO.DirectoryInfo] $SelectedFolder<br>\r\n&nbsp;&nbsp;&nbsp; } else {<br>\r\n&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return $null<br>\r\n&nbsp;&nbsp;&nbsp; }&nbsp;&nbsp;&nbsp; <br>\r\n}</p>\r\n<p><br>\r\n$saveEvtHnd = {<br>\r\n&nbsp;&nbsp;&nbsp; if ($_.EventType -eq [Ionic.Zip.ZipProgressEventType]::Saving_BeforeWriteEntry)<br>\r\n&nbsp;&nbsp;&nbsp; {<br>\r\n&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; try {<br>\r\n&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $status = [Math]::Floor($_.EntriesSaved / $_.EntriesTotal * 100).ToString() &#43; &quot;% Complete&quot;&nbsp;&nbsp;&nbsp; &nbsp;<br>\r\n&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Write-Progress -Id 1 -Activity &quot;Creating: '$($_.ArchiveName)'&quot; -Status $status -PercentComplete ($_.EntriesSaved / $_.EntriesTotal * 100)<br>\r\n&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; } catch {<br>\r\n&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; throw $_<br>\r\n&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>\r\n&nbsp;&nbsp;&nbsp; } elseif ($_.EventType -eq [Ionic.Zip.ZipProgressEventType]::Saving_EntryBytesRead) {<br>\r\n&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; try {<br>\r\n&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $status = [Math]::Floor($_.BytesTransferred / $_.TotalBytesToTransfer * 100).ToString() &#43; &quot;% Complete&quot;&nbsp;&nbsp;&nbsp;\r\n<br>\r\n&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Write-Progress -Id 2 -ParentId 1 -Activity &quot;Adding file: '$($_.CurrentEntry.FileName)'&quot; -Status $status -PercentComplete ($_.BytesTransferred / $_.TotalBytesToTransfer * 100)<br>\r\n&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; } catch {<br>\r\n&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; throw $_<br>\r\n&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>\r\n&nbsp;&nbsp;&nbsp; }<br>\r\n}<br>\r\n<br>\r\n#endregion<br>\r\n<br>\r\n$scriptHome = [IO.DirectoryInfo] (Get-ScriptDirectory)<br>\r\n<br>\r\n$assem = [System.Reflection.Assembly]::LoadFrom( [IO.Path]::Combine($scriptHome, &quot;Ionic.Zip.dll&quot;) )<br>\r\n$assem = [System.Reflection.Assembly]::LoadFrom( [IO.Path]::Combine($scriptHome, &quot;Ionic.Zlib.dll&quot;) )<br>\r\n<br>\r\n$inputDir = Show-FolderBrowser -Prompt &quot;Select input directory&quot;<br>\r\n$outputDir = Show-FolderBrowser -Prompt &quot;Select output directory&quot;<br>\r\n<br>\r\n$maxAttempts = 100<br>\r\n<br>\r\n$DebugPreference = &quot;Continue&quot;<br>\r\n<br>\r\n1..$maxAttempts | % {<br>\r\n&nbsp;&nbsp;&nbsp; $iteration = $_<br>\r\n&nbsp;&nbsp;&nbsp; try {<br>\r\n&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>\r\n&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $archiveSegmentSize = [Math]::Floor((Get-Random -Minimum 1MB -Maximum 200MB))<br>\r\n&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>\r\n&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $name = [IO.Path]::GetFileNameWithoutExtension([IO.Path]::GetRandomFileName())<br>\r\n&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>\r\n&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $outFolder = [IO.DirectoryInfo] ([IO.Path]::Combine($outputDir, &quot;$name $archiveSegmentSize&quot;))<br>\r\n&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $outFolder.Create()<br>\r\n&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>\r\n&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $outZip = [IO.FileInfo] ([IO.Path]::Combine($outFolder, ($name &#43; &quot;.zip&quot;)))<br>\r\n&nbsp;&nbsp;&nbsp; <br>\r\n&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $zipfile = new-object Ionic.Zip.ZipFile<br>\r\n&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $zipfile.add_SaveProgress($saveEvtHnd)<br>\r\n&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $zipfile.UseZip64WhenSaving = [Ionic.Zip.Zip64Option]::AsNecessary<br>\r\n&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $zipfile.AddDirectory($inputDir.fullname)<br>\r\n&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $zipfile.MaxOutputSegmentSize = $archiveSegmentSize<br>\r\n&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $zipfile.Save($outZip.Fullname)<br>\r\n<br>\r\n&nbsp;&nbsp;&nbsp; } catch {<br>\r\n&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; throw &quot;Failed to run iteration ${iteration}. The error was: '$_'.&quot;<br>\r\n&nbsp;&nbsp;&nbsp; }<br>\r\n}<br>\r\n<br>\r\nRead-Host &quot;Done&quot;</p>\r\n",
    "PostedDate": "2010-12-21T20:04:57.23-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "626556",
    "ThreadId": "239172",
    "Html": "<p>this is the same problem i'm facing.. did u ever got any solution for this ??</p>",
    "PostedDate": "2011-06-12T05:34:09.117-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "629478",
    "ThreadId": "239172",
    "Html": "<p>I don't believe that Windows Explorer's built-in zip capability (aka Compressed Folders) supports spanned zip files.</p>\r\n<p>I could be wrong about this.&nbsp; However, my understanding is consistent with what antize reported above.</p>",
    "PostedDate": "2011-06-17T23:04:56.353-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "1202282",
    "ThreadId": "239172",
    "Html": "I have the same issue using DotNetZip version 1.9.1.8. It does not appear to be fixed. Windows 7 does support opening spanned zip files - some files spanned using DotNetZip open just fine. Others fail with &quot;The same volume can not be used as both the source and destination&quot;.<br />\n",
    "PostedDate": "2014-02-03T16:01:22.003-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  }
]