[
  {
    "Id": "651803",
    "ThreadId": "267600",
    "Html": "\r\n<p>You are right about replying to two year old discussions, my miss.&nbsp;By the way, congrats for the new release. Just downloaded it.</p>\r\n<p>Original Post:</p>\r\n<p>Hey Cheeso,</p>\r\n<p>first things first, dotNetZip is awesome. I recently implemented a backup &amp; restore function. Works like charm.</p>\r\n<p>When debugging the code I also encountered the PathTooLongException, using ZipFile.AddDirectory() to save a zip. Problem here, the resulting exception doesn't even say which path was to long or whatever. Using the DotNetZip devkit I saw this happened in\r\n ZipEntry.Create when File (Directory) will be first accessed with File.GetLastWriteTime(filename) (line 2402). Well, the path really was too long :).</p>\r\n<p>On the other hand two functions in dotNetZip could be helpfull.</p>\r\n<p>1. throw custom Exception that actually tells you the path.</p>\r\n<p>2. A flag like IgnoreInvalidPaths (perhaps combined with an event InvalidPathEncountered) could help scenarious were you just want to zip what you get out of a directory.&nbsp;</p>\r\n<p>Just a suggestion. Thx again, saved me tons of time.</p>\r\n",
    "PostedDate": "2011-08-03T08:16:20.213-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "651815",
    "ThreadId": "267600",
    "Html": "<p>Thanks again for the kind words. I'm glad you like the library.</p>\r\n<p>You said you just downloaded the new release.&nbsp; What version of the library were you using when you encountered the problems you are reporting?</p>\r\n<p>Can you give me the full exception stacktrace on the \"path too long\" exception?&nbsp; Even better, can you give me a simple test case that reproduces the problem?&nbsp; What does it mean \"the path really was too long\"?&nbsp; How long was the path?&nbsp;</p>\r\n<p>Also I am interested in your suggestion, but... I don't know what you mean by&nbsp; \"scenarious were you just want to zip what you get out of a directory\".&nbsp;&nbsp; Can you elaborate on that?&nbsp; How is it different than what dotnetzip does today?</p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>",
    "PostedDate": "2011-08-03T08:38:36.843-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "653764",
    "ThreadId": "267600",
    "Html": "<p>The exception I got zipping a directory was the System.IO.PathTooLongException. -&nbsp;<a href=\"http://msdn.microsoft.com/de-de/library/system.io.pathtoolongexception.aspx\">http://msdn.microsoft.com/de-de/library/system.io.pathtoolongexception.aspx</a></p>\r\n<p>A subdirectory of the directory I wanted to zip had a path longer than 259 characters (267 :) ), apparently the maximum path length the .NET IO system can handle. So the error was due to the .net limit. I found a nice blog post about this and how to use Win32 to access file/folders with &gt;260 path length.&nbsp;</p>\r\n<p><a href=\"http://blogs.msdn.com/b/bclteam/archive/2007/02/13/long-paths-in-net-part-1-of-3-kim-hamilton.aspx\">http://blogs.msdn.com/b/bclteam/archive/2007/02/13/long-paths-in-net-part-1-of-3-kim-hamilton.aspx</a></p>\r\n<p>If you zip such a directory, the whole process fails.&nbsp;What really bothered me was to find out which file/directory was too long, because the PathTooLongException doesn't return the path value. So it would be nice if you would catch this PathTooLongException and return a custom exception that tells u the path.</p>\r\n<p>What I meant with&nbsp;\"scenarious were you just want to zip what you get out of a directory\", that u cannot use the ZipFile.AddDirectory() if one of the subdirectories or files exceeds the 259 character limit. &nbsp;If there would be flag like IgnoreInvalidPaths, everything would be zipped except pathes that are too long or u got no access permission or whatever.&nbsp;</p>\r\n<p>On the other hand u could try using the Win32 api to zip/unzip pathes with length up to 32k. I admit, most dotnetzip users perhaps never encounter this limit, so I don't know if it's worth the trouble using Win32 calls.&nbsp;</p>",
    "PostedDate": "2011-08-06T10:30:00.317-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "653799",
    "ThreadId": "267600",
    "Html": "This discussion has been copied to a work item. Click <a href=\"http://dotnetzip.codeplex.com/workitem/14035\">here</a> to go to the work item and continue the discussion.",
    "PostedDate": "2011-08-06T11:19:59.57-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  }
]