[
  {
    "Id": "199580",
    "ThreadId": "58943",
    "Html": "<p>I've experienced the following issue. Looks like it may be a bug. The goal is to recursively walk a path and place all files in the root of the archive with no folders.</p>\r\n<p>Files involved:</p>\r\n<p>C:\\temp\\test1.txt<br> C:\\temp\\test2.txt<br> C:\\temp\\folder1\\text3.txt<br> C:\\temp\\folder2\\test4.txt</p>\r\n<p>If I make the following call, I only end up with test1.txt and test2.txt in the root of the archive. Even though &quot;recursive&quot; is set to true it is not walking the tree. Notice that directoryPathInArchive is set to empty string so that all files in placed in root. If I make thecall without the directoryPathInArchive property the tree is walked as expected. It seems to be the combination of directoryPathInArchive=&quot;&quot; and recursive=true that is causing the problem.</p>\r\n<p>zip.AddSelectedFiles(&quot;*.*&quot;, filePathToZip, &quot;&quot;, true);&nbsp; &nbsp; &nbsp; // with filePathToZip being &quot;C:\\temp&quot;</p>\r\n<p>Is this a known issue or is my implementation incorrect?</p>\r\n<p>Thanks,<br> Bob</p>",
    "PostedDate": "2009-06-09T09:46:43.53-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "200655",
    "ThreadId": "58943",
    "Html": "<p>Hey Bob,</p>\r\n<p>in fact, I think the behavior that you are seeing is correct.&nbsp;</p>\r\n<p>All the files are included in the resulting zip, but the directory structure on the disk is reproduced in the zip file, rooted in the zip file at &quot;&quot;.&nbsp;</p>\r\n<p>This is not what you were expecting.&nbsp; It sounds like you expected the directory structure to be flattened, but this is not what the method is expected to do.&nbsp; In fact the expected behavior is to reproduce the dir hierarchy from the filesystem , in the zip file, but rooting it at the directory you specify in the zip file.&nbsp;</p>\r\n<p>I just checked this myself, and in fact you are correct - the files in the base directory (in your case c:\\temp) are the only ones that appear in the root in the zip archive.&nbsp; But, the rest of the files are in the zip archive, in a directory tree that reflects the filesystem.</p>\r\n<p>I also checked the documentation, and in fact it does not state clearly that the filesystem hierarchy is NOT flattened. &nbsp; I will update the doc to state it more clearly.</p>\r\n<p>&nbsp;</p>",
    "PostedDate": "2009-06-11T18:12:38.453-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "200692",
    "ThreadId": "58943",
    "Html": "<p>Cheeso,</p>\r\n<p>Thanks for the quick reply. I don't believe I made the part about the files in the root very clear. In my tests (just ran them again) the only files I get AT ALL in the archive are the two in the root. The folder structure is gone entirely. Whether &quot;recursive&quot; is set to true or false I get the exact same result: test1.txt and test2.txt in the root of the archive and nothing else - no other files - no other folders.</p>\r\n<p>Thanks again for any help you can provide.</p>\r\n<p>- Bob</p>",
    "PostedDate": "2009-06-11T23:34:28.813-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "200757",
    "ThreadId": "58943",
    "Html": "This discussion has been copied to a work item. Click <a href=\"http://dotnetzip.codeplex.com/WorkItem/View.aspx?WorkItemId=7883\">here</a> to go to the work item and continue the discussion.",
    "PostedDate": "2009-06-12T04:00:57.1-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "200759",
    "ThreadId": "58943",
    "Html": "<p>Bob,</p>\r\n<p>I created a workitem, <a href=\"http://dotnetzip.codeplex.com/WorkItem/View.aspx?WorkItemId=7883\">http://dotnetzip.codeplex.com/WorkItem/View.aspx?WorkItemId=7883</a>&nbsp;</p>\r\n<p>Attached to that work item is a test case.&nbsp; Can you download it, compile it, and tell me the results you get? b</p>",
    "PostedDate": "2009-06-12T04:05:32.27-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "201201",
    "ThreadId": "58943",
    "Html": "<p>Bob, Any update? did you get a chance to download and run that test case?</p>",
    "PostedDate": "2009-06-13T12:33:10.42-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "201771",
    "ThreadId": "58943",
    "Html": "<p>Cheeso, ran the test case and posted a response to the work item.</p>",
    "PostedDate": "2009-06-15T15:00:37.92-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "201817",
    "ThreadId": "58943",
    "Html": "<p>Ok, thanks.&nbsp; That's baffling.&nbsp; Can you post the zip file that gets produced by the test program?&nbsp; And also the actual output of the program - the text it prints on the console.&nbsp;<br>This is the output from <em>my</em> run:</p>\r\n<pre>clearing dir bobdir\r\ncreating dir bobdir\r\nCreating file 'bobdir\\Test1.txt' size(1856)\r\nCreating file 'bobdir\\Test2.txt' size(621)\r\nCreating file 'bobdir\\folder1\\Test3.txt' size(1374)\r\nCreating file 'bobdir\\folder2\\Test4.txt' size(1471)\r\nDeleting file BobCheckItOut.zip\r\nCreating zip file BobCheckItOut.zip\r\nadding selection '*.*' from dir 'bobdir'...\r\nfound 4 files...\r\nadding bobdir\\Test1.txt...\r\nadding bobdir\\Test2.txt...\r\nadding bobdir\\folder1\\Test3.txt...\r\nadding bobdir\\folder2\\Test4.txt...\r\nsaving....\r\n\r\nChecking file BobCheckItOut.zip\r\n  Entry: Test1.txt\r\n  Entry: Test2.txt\r\n  Entry: /folder1/Test3.txt\r\n  Entry: /folder2/Test4.txt\r\n</pre>",
    "PostedDate": "2009-06-15T17:53:33.717-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  }
]