[
  {
    "Id": "163932",
    "ThreadId": "49069",
    "Html": "I create a zip file compressing the my documents folder. Success<br>\r\nI restore that same zip file. Success<br>\r\nI update that zip file. Success<br>\r\nI restore the updated zip file. Fail<br>\r\n<br>\r\nUsing 1.7.2.11<br>\r\n<br>\r\nStack trace:<br>\r\nIonic.Zip.BadCrcException was unhandled<br>\r\n  Message=&quot;CRC error: the file being extracted appears to be corrupted. Expected 0x988D51D7, Actual 0x9F89C723&quot;<br>\r\n  Source=&quot;Ionic.Zip&quot;<br>\r\n  StackTrace:<br>\r\n       at Ionic.Zip.ZipEntry.InternalExtract(String baseDir, Stream outstream, String password) in c:\\dinoch\\dev\\dotnet\\zip\\releases\\v1.7.2.10\\src\\DotNetZip\\Zip Partial DLL\\ZipEntry.cs:line 1865<br>\r\n       at Ionic.Zip.ZipEntry.Extract(String baseDirectory, Boolean overwrite) in c:\\dinoch\\dev\\dotnet\\zip\\releases\\v1.7.2.10\\src\\DotNetZip\\Zip Partial DLL\\ZipEntry.cs:line 1414<br>\r\n       at Ionic.Zip.ZipFile.ExtractAll(String path, Boolean wantOverwrite) in c:\\dinoch\\dev\\dotnet\\zip\\releases\\v1.7.2.10\\src\\DotNetZip\\Zip Partial DLL\\ZipFile.cs:line 5586<br>\r\n       at SMG_Backup.MainForm.ZipRestore(String SourceFile, String DestFolder) in C:\\Users\\jeffy.SELLETHICS\\Documents\\Visual Studio 2005\\Projects\\SMG Backup\\SMG Backup\\MainForm.vb:line 367<br>\r\n       at SMG_Backup.MainForm.restoreFileBTN_Click(Object sender, EventArgs e) in C:\\Users\\jeffy.SELLETHICS\\Documents\\Visual Studio 2005\\Projects\\SMG Backup\\SMG Backup\\MainForm.vb:line 349<br>\r\n       at System.Windows.Forms.Control.OnClick(EventArgs e)<br>\r\n       at System.Windows.Forms.Button.OnClick(EventArgs e)<br>\r\n       at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)<br>\r\n       at System.Windows.Forms.Control.WmMouseUp(Message&amp; m, MouseButtons button, Int32 clicks)<br>\r\n       at System.Windows.Forms.Control.WndProc(Message&amp; m)<br>\r\n       at System.Windows.Forms.ButtonBase.WndProc(Message&amp; m)<br>\r\n       at System.Windows.Forms.Button.WndProc(Message&amp; m)<br>\r\n       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&amp; m)<br>\r\n       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&amp; m)<br>\r\n       at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)<br>\r\n       at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG&amp; msg)<br>\r\n       at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)<br>\r\n       at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)<br>\r\n       at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)<br>\r\n       at System.Windows.Forms.Application.Run(ApplicationContext context)<br>\r\n       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()<br>\r\n       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()<br>\r\n       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)<br>\r\n       at SMG_Backup.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81<br>\r\n       at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)<br>\r\n       at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)<br>\r\n       at System.Runtime.Hosting.ManifestRunner.Run(Boolean checkAptModel)<br>\r\n       at System.Runtime.Hosting.ManifestRunner.ExecuteAsAssembly()<br>\r\n       at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[] activationCustomData)<br>\r\n       at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext)<br>\r\n       at System.Activator.CreateInstance(ActivationContext activationContext)<br>\r\n       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()<br>\r\n       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)<br>\r\n       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)<br>\r\n       at System.Threading.ThreadHelper.ThreadStart()<br>\r\n",
    "PostedDate": "2009-03-03T08:51:09.607-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "164001",
    "ThreadId": "49069",
    "Html": "In doing more testing, this may have to do more with the update process (I was thinking restore orignially).<br>\r\nI can create a zip archive with success, update the archive with success (success on the surface anyway)...if I update the updated archive (in other words a second update) I get an arithmetic error.<br>\r\nSo I'm guessing that the file structure is changing on the original zip archive after I update it the first time, which would explain why I cound not restore (original post) or update it a second time (this post).<br>\r\nA penny for your thoughts...<br>\r\n<br>\r\nStack trace on updating a second time:<br>\r\n<br>\r\nSystem.OverflowException was unhandled<br>\r\n  Message=&quot;Arithmetic operation resulted in an overflow.&quot;<br>\r\n  Source=&quot;Ionic.Zip&quot;<br>\r\n  StackTrace:<br>\r\n       at Ionic.Zip.ZipEntry.CopyThroughOneEntry(Stream outstream) in c:\\dinoch\\dev\\dotnet\\zip\\releases\\v1.7.2.10\\src\\DotNetZip\\Zip Partial DLL\\ZipEntry.cs:line 3430<br>\r\n       at Ionic.Zip.ZipEntry.Write(Stream outstream) in c:\\dinoch\\dev\\dotnet\\zip\\releases\\v1.7.2.10\\src\\DotNetZip\\Zip Partial DLL\\ZipEntry.cs:line 3242<br>\r\n       at Ionic.Zip.ZipFile.Save() in c:\\dinoch\\dev\\dotnet\\zip\\releases\\v1.7.2.10\\src\\DotNetZip\\Zip Partial DLL\\ZipFile.cs:line 2915<br>\r\n       at SMG_Backup.MainForm.ZipUpdate(String OriginalFile) in C:\\Users\\jeffy.SELLETHICS\\Documents\\Visual Studio 2005\\Projects\\SMG Backup\\SMG Backup\\MainForm.vb:line 197<br>\r\n       at SMG_Backup.MainForm.btnUpdate_Click(Object sender, EventArgs e) in C:\\Users\\jeffy.SELLETHICS\\Documents\\Visual Studio 2005\\Projects\\SMG Backup\\SMG Backup\\MainForm.vb:line 117<br>\r\n       at System.Windows.Forms.Control.OnClick(EventArgs e)<br>\r\n       at System.Windows.Forms.Button.OnClick(EventArgs e)<br>\r\n       at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)<br>\r\n       at System.Windows.Forms.Control.WmMouseUp(Message&amp; m, MouseButtons button, Int32 clicks)<br>\r\n       at System.Windows.Forms.Control.WndProc(Message&amp; m)<br>\r\n       at System.Windows.Forms.ButtonBase.WndProc(Message&amp; m)<br>\r\n       at System.Windows.Forms.Button.WndProc(Message&amp; m)<br>\r\n       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&amp; m)<br>\r\n       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&amp; m)<br>\r\n       at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)<br>\r\n       at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG&amp; msg)<br>\r\n       at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)<br>\r\n       at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)<br>\r\n       at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)<br>\r\n       at System.Windows.Forms.Application.Run(ApplicationContext context)<br>\r\n       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()<br>\r\n       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()<br>\r\n       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)<br>\r\n       at SMG_Backup.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81<br>\r\n       at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)<br>\r\n       at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)<br>\r\n       at System.Runtime.Hosting.ManifestRunner.Run(Boolean checkAptModel)<br>\r\n       at System.Runtime.Hosting.ManifestRunner.ExecuteAsAssembly()<br>\r\n       at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[] activationCustomData)<br>\r\n       at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext)<br>\r\n       at System.Activator.CreateInstance(ActivationContext activationContext)<br>\r\n       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()<br>\r\n       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)<br>\r\n       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)<br>\r\n       at System.Threading.ThreadHelper.ThreadStart()<br>\r\n",
    "PostedDate": "2009-03-03T11:15:58.84-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "164004",
    "ThreadId": "49069",
    "Html": "<p>Sounds like a reasonable theory Jeff. </p>\r\n<p>What do you mean by &quot;Restore the original file&quot; ? </p>\r\n<p>Does that mean you call  ZipFile.Read(), then add back in the file you had previously removed? </p>\r\n<p>How big is that zip file? how many entries? </p>\r\n<p>I will try some tests here.</p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>\r\n",
    "PostedDate": "2009-03-03T11:18:41.907-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "164011",
    "ThreadId": "49069",
    "Html": "First test:<br>\r\nI create jeff.zip = success.<br>\r\nI restore jeff.zip = success.<br>\r\nI make changes to files/folders in My Documents, then update jeff.zip = success (on the surface).<br>\r\nI try to restore jeff.zip after the update and it fails.<br>\r\n<br>\r\nSecond test:<br>\r\nI create jeff.zip = success.<br>\r\nI make changes to files/folders in My Documents, then update jeff.zip = success (on the surface).<br>\r\nI make changes again to files/folders in My Documents, then update jeff.zip again = fail.<br>\r\n<br>\r\nMy code (for the most part):<br>\r\nSave zip archive-<br>\r\n            zipArchive.AddDirectory(SourceFolder)<br>\r\n            zipArchive.CompressionLevel = Zlib.CompressionLevel.LEVEL9_BEST_COMPRESSION<br>\r\n            zipArchive.UseZip64WhenSaving = Ionic.Zip.Zip64Option.Always<br>\r\n            zipArchive.TempFileFolder = txtFolderSave.Text<br>\r\n            zipArchive.Save(DestFile)<br>\r\n            <br>\r\nExtract (restore) archive-<br>\r\n            zipExtract = Zip.ZipFile.Read(SourceFile)<br>\r\n            zipExtract.ExtractAll(DestFolder, True)<br>\r\n<br>\r\nUpdate the zip archive-<br>\r\n            zipFileUpdate = Zip.ZipFile.Read(OriginalFile)<br>\r\n            zipFileUpdate.UseZip64WhenSaving = Zip.Zip64Option.Always<br>\r\n            zipFileUpdate.CompressionLevel = Zlib.CompressionLevel.BEST_COMPRESSION<br>\r\n            zipFileUpdate.TempFileFolder = txtParBackup.Text.Substring(0, 3)<br>\r\n            zipFileUpdate.Save()<br>\r\n<br>\r\nthe rest of the update code-<br>\r\n<p> 'pass 1, enumerate zip entries and mark them for removal if they no longer exist in sourcefolder<br>\r\n            Dim MarkFileRemove As New System.Collections.Generic.List(Of Zip.ZipEntry)<br>\r\n            For Each FileEntryRemove As Zip.ZipEntry In zipFileUpdate<br>\r\n                Dim PathNamePass1 As String = System.IO.Path.Combine(zipSource, FileEntryRemove.FileName)<br>\r\n                If Not System.IO.File.Exists(PathNamePass1) Then<br>\r\n                    MarkFileRemove.Add(FileEntryRemove)<br>\r\n                End If<br>\r\n            Next</p>\r\n<p>            'remove entries from pass 1<br>\r\n            For Each RemoveFile As Zip.ZipEntry In MarkFileRemove<br>\r\n                zipFileUpdate.RemoveEntry(RemoveFile)<br>\r\n            Next</p>\r\n<p>            'pass 2, enumerate files in source folder, if file doesn't exist in zip file, add them<br>\r\n            Dim AddNewSourceFile As New System.Collections.Generic.List(Of System.IO.FileInfo)<br>\r\n            Dim SourceDir As New IO.DirectoryInfo(zipSource)<br>\r\n            Dim AllFiles As IO.FileInfo() = SourceDir.GetFiles(&quot;*.*&quot;, SearchOption.AllDirectories)<br>\r\n            For Each ExistingFile As IO.FileInfo In AllFiles<br>\r\n                If Not zipFileUpdate.EntryFileNames.Contains(Replace(Replace(ExistingFile.FullName, zipSource &amp; &quot;\\&quot;, string.Empty), &quot;\\&quot;, &quot;/&quot;)) Then<br>\r\n                    AddNewSourceFile.Add(ExistingFile)<br>\r\n                End If<br>\r\n            Next</p>\r\n<p>            'add entries from pass 2<br>\r\n            For Each AddNewFile As System.IO.FileInfo In AddNewSourceFile<br>\r\n                Dim PathToFile As String = AddNewFile.FullName<br>\r\n                Dim zipDirectoryPath As String = Replace(AddNewFile.Directory.FullName, zipSource, String.Empty)<br>\r\n                If zipDirectoryPath.StartsWith(&quot;\\&quot;) = True Then<br>\r\n                    zipFileUpdate.AddItem(PathToFile, zipDirectoryPath.Substring(1))<br>\r\n                Else<br>\r\n                    zipFileUpdate.AddItem(PathToFile, zipDirectoryPath)<br>\r\n                End If<br>\r\n            Next</p>\r\n<p>            'pass 3, enumerate zip entries, compare date to original file in source folder, update entry if necessary<br>\r\n            Dim CompareFile As New System.Collections.Generic.List(Of Zip.ZipEntry)<br>\r\n            For Each oldFileEntry As Zip.ZipEntry In zipFileUpdate<br>\r\n                Dim PathName As String = System.IO.Path.Combine(zipSource, oldFileEntry.FileName)<br>\r\n                If System.IO.File.Exists(PathName) Then<br>\r\n                    Dim infoReader As System.IO.FileInfo<br>\r\n                    infoReader = My.Computer.FileSystem.GetFileInfo(PathName)<br>\r\n                    If (oldFileEntry.LastModified.Date &lt; infoReader.LastWriteTime.Date) Then<br>\r\n                        CompareFile.Add(oldFileEntry)<br>\r\n                    End If<br>\r\n                End If<br>\r\n            Next</p>\r\n<p>            'add entries from pass 3<br>\r\n            For Each ReplaceFile As Zip.ZipEntry In CompareFile<br>\r\n                Dim PathToFile As String = System.IO.Path.Combine(zipSource, ReplaceFile.FileName)<br>\r\n                Dim zipDirectoryPath As String = System.IO.Path.GetDirectoryName(ReplaceFile.FileName)<br>\r\n                zipFileUpdate.RemoveEntry(ReplaceFile)<br>\r\n                zipFileUpdate.UpdateFile(PathToFile, zipDirectoryPath)<br>\r\n            Next</p>\r\nThe zip archive (jeff.zip) is 192MB.<br>\r\n<br>\r\n<br>\r\n..I like Tomlin, ex-Bucs DB coach. Great motivator.<br>\r\n                \r\n",
    "PostedDate": "2009-03-03T11:33:20.817-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "164057",
    "ThreadId": "49069",
    "Html": "Ok, let me have a look at your code.  I tried here with my own logic but couldn't get it to break. <br>\r\n<br>\r\nps: I like Tomlin, too.  He seems very wise, very sharp.<br>\r\n",
    "PostedDate": "2009-03-03T13:16:05.76-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "164060",
    "ThreadId": "49069",
    "Html": "I'm going thru my code as well. I can't be sure, but I don't remember this being an issue - not much has changed. Hmmmm...\r\n",
    "PostedDate": "2009-03-03T13:27:23.617-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "164067",
    "ThreadId": "49069",
    "Html": "Ok, I was able to get an Arithmetic Overflow using code structured as above. <br>\r\nThis seems like a bug in DotNetZip.  I'll look into it and see if I can track it down and fix it. \r\n",
    "PostedDate": "2009-03-03T13:45:37.57-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "164070",
    "ThreadId": "49069",
    "Html": "Ahh..good (although not for you) - I was starting to think I was losing it...<br>\r\nI know my code structure isn't the greatest being a rookie, so I hope that isn't causing you too much headache.<br>\r\n---------------<br>\r\n(Speaking of rookie, Limas Sweed better step up next year. Ward is getting rough around the edges, Washington went to the Titans, and Holmes (whom I draft every FFL year - then ultimately trade when he's doing good) is inconsistent. I'm thinking they draft a WR.)\r\n",
    "PostedDate": "2009-03-03T13:54:57.453-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "164184",
    "ThreadId": "49069",
    "Html": "Ha! I had Holmes this year in my FFL but he was spotty.  I totally agree with your assessment on the WR corps of the Steelers, though. Ward is on the decline I think.  Still a leader but his production is declining.<br>\r\n<br>\r\nOk, good news / bad news.  The good news is that I found and fixed the problem. <br>\r\nThe bad news is that I made the changes to v1.8 I haven't yet ported them to v1.7. <br>\r\n<br>\r\nI'd like it if you can try it out on v1.8.1.7 and let me know if that fixes your problem.  In the meantime I will look into back-porting the changes to v1.7. <br>\r\nAlso - the ability to include or exclude files in the things you are zipping up - I think you asked for that?  - that feature is also available in v1.8.  Check it out.\r\n",
    "PostedDate": "2009-03-03T23:01:41.76-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "164200",
    "ThreadId": "49069",
    "Html": "OK, v1.7.2.12 includes the fix.  It's available now. <br>\r\nI'd like you to try it out, or the v1.8 version.  Or both if you like. <br>\r\nOnly v1.8 gets the include-or-exclude-files-in-the-Add-or-Extract feature.<br>\r\n",
    "PostedDate": "2009-03-04T00:24:46.987-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "164345",
    "ThreadId": "49069",
    "Html": "Using 1.8.1.7 now and it seems to be just fine. Initial tests are successful so I'm going to test then roll out the app. I appreciate all the help, I really do.<br>\r\n-------<br>\r\nIf you're interested, I'm commish of a Yahoo 10 team FFL - $65 entry, weekly payouts as well as division winner, champ and runner up payout. I have one person not returning..if you want more details let me know.\r\n",
    "PostedDate": "2009-03-04T07:50:39.807-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "165480",
    "ThreadId": "49069",
    "Html": "Using 1.8.1.7 - how do you exclude a file using the zip.AddDirectory?<br>\r\nIn example, excluding &quot;*.pst&quot; file(s). I was thinking there was a zip.addDirectory(source, filestoexclude) kind of thing..\r\n",
    "PostedDate": "2009-03-06T11:59:44.597-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "165526",
    "ThreadId": "49069",
    "Html": "ZipFile.AddSelectedFiles(&quot;name != *.pst&quot;, MyDirectory, True) <br>\r\n<br>\r\nTrue  means &quot;recurse directories&quot;. <br>\r\n<br>\r\n<br>\r\n",
    "PostedDate": "2009-03-06T14:47:37.39-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  }
]