[
  {
    "Id": "640811",
    "ThreadId": "264762",
    "Html": "\r\n<p>Hi,</p>\r\n<p>&nbsp;</p>\r\n<p>I have an existing zip file. I would like to create a copy of this but saved using spans.</p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;&nbsp;&nbsp; using (var someZip = ZipFile.Read(@&quot;c:\\original.zip&quot;))<br>\r\n&nbsp;&nbsp;&nbsp; {<br>\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; someZip.MaxOutputSegmentSize := 65536;<br>\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; someZip.Save(@&quot;c:\\somezip.zip&quot;);<br>\r\n&nbsp;&nbsp;&nbsp; }</p>\r\n<p>&nbsp;</p>\r\n<p>Using dotnetzip-winformtool.exe I can open somezip.zip but if I try and extract the contents I get errors for some files.</p>\r\n<p>&nbsp;</p>\r\n<p>For example</p>\r\n<p>&nbsp;</p>\r\n<p>&quot;faisled to extract entry somefile.txt&nbsp; -- bad state (invalid block type)</p>\r\n<p>&nbsp;</p>\r\n<p>Is this a reasonable thing to do ?</p>\r\n<p>I tried creating a new file, adding documents and then saving in segments. This worked out but I would prefer to open existing file and then save in segments.</p>\r\n<p>&nbsp;</p>\r\n<p>Cheers,</p>\r\n<p>John</p>\r\n",
    "PostedDate": "2011-07-11T19:48:36.823-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "641302",
    "ThreadId": "264762",
    "Html": "<p>I guess it seems like a reasonable thing to do, but I don't know if it will actually work.</p>\r\n<p>I don't know every test in the test suite, there are now 350+ tests, but I don't recall actually testing the scenario you described.</p>\r\n<p>There have been other problems reported related to spanned archives; I've fixed those in v1.9.1.6000 (the alpha version of v1.9.1.6), but these problems still exist in v1.9.1.5.&nbsp;&nbsp; It may be that you are seeing the results of those kinds of things.&nbsp; You might consider trying the download of v1.9.1.600, which is available since yesterday.</p>\r\n<p>In the meantime I will also try to test this with both v1.9.1.5 and v1.9.1.6000 .</p>\r\n<p>&nbsp;</p>",
    "PostedDate": "2011-07-12T12:45:50.523-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "641427",
    "ThreadId": "264762",
    "Html": "<p>Thanks for the reply. I tried with the latest code but I still get the problem.</p>\r\n<p>&nbsp;</p>\r\n<p>Something else I looked into was adding files to an already existing zip that is using spanning.</p>\r\n<p>&nbsp;</p>\r\n<p>For example</p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; foreach (var pdf in pdfFiles)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; using (var outputZip = new ZipFile(@\"c:\\temp\\span.zip\"))<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; outputZip.MaxOutputSegmentSize = 1417123;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; outputZip.AddFile(pdf);<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; outputZip.Save();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p>\r\n<p>&nbsp;</p>\r\n<p>When I call Save the second time through the loop there is already an span.z01 but an exception is raised in</p>\r\n<p>Ionic.Zip.ZipSegmentedStream._SetWriteStream(UInt32 increment) in c:\\DotNetZip\\Zip Partial DLL\\ZipSegmentedStream.cs:line 317</p>\r\n<p>because its trying to delete span.z01 and it appears to have the file open.</p>\r\n<p>What I'm trying to do is build a zip file and break it up into segments. I can't add all the files at the same time and I might need to open the file up a few times and add more files until completion.</p>\r\n<p>Everything seems to work ok if I use 1 zip but when I try and make use of spanning I seem to run into problems.</p>\r\n<p>&nbsp;</p>\r\n<p>Cheers,</p>\r\n<p>John</p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>",
    "PostedDate": "2011-07-12T18:58:58.13-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "641859",
    "ThreadId": "264762",
    "Html": "This discussion has been copied to a work item. Click <a href=\"http://dotnetzip.codeplex.com/workitem/13915\">here</a> to go to the work item and continue the discussion.",
    "PostedDate": "2011-07-13T11:51:20.757-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "642023",
    "ThreadId": "264762",
    "Html": "This discussion has been copied to a work item. Click <a href=\"http://dotnetzip.codeplex.com/workitem/13918\">here</a> to go to the work item and continue the discussion.",
    "PostedDate": "2011-07-13T16:47:36.843-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "642041",
    "ThreadId": "264762",
    "Html": "<p>OK thanks John.</p>\r\n<p>Try out the v1.9.1.6001 binary DLL .&nbsp; I've reproduced the problem here, and implemented a fix for your 1st scenario:&nbsp; read a regular zip and then save it to a spanned zip.&nbsp; (the DLLs are on the downloads tab)</p>\r\n<p>I haven't addressed the second scenario - read a spanned zip and then re-save it to the same name.&nbsp; I need to think about that one a little more.</p>\r\n<p>&nbsp;</p>",
    "PostedDate": "2011-07-13T17:13:23.527-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  }
]