[
  {
    "Id": "109414",
    "ThreadId": "33014",
    "Html": "Hello,<br>\r\nthank you very much for this really easy to use and efficient library!<br>\r\n<br>\r\nWhile using it with directories I get some surprising results: the parent directories (ie the beginning of the directory path) are also included in the zip file.<br>\r\nI use DotNet Zip Library 1.5 and .Net 3.0; on XP SP2<br>\r\n<br>\r\nI have the following directory structure:<br>\r\nc:\\Temp\\RepToZip<br>\r\ncontains: file test01.txt; test02.txt and a sub directory named RepSubDir; which also has some files in it<br>\r\n<br>\r\nTo test the library, I put the .dll file and Zipit.exe in c:\\temp directory.<br>\r\n<br>\r\nIn the command line, I call:<br>\r\nzipit.exe test.zip &quot;c:\\temp\\RepToZip&quot;<br>\r\nThis should zip only the RepToZip dir and its content.<br>\r\n<br>\r\nWhat I get when I unzip it in c:\\temp is another &quot;temp&quot; folder containing the RepToZip directory.<br>\r\n<br>\r\nIs there a way not to get it, but to get the RepToZip and its content instead?<br>\r\n<br>\r\n<br>\r\nThank you very much\r\n",
    "PostedDate": "2008-08-06T10:51:01.06-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "109416",
    "ThreadId": "33014",
    "Html": "<p>YES, it is&nbsp;possible to not include the full directory path in zipped archives created by DotNetZip. </p>\r\n<p>To do this, you need to use the overload of Add{File,Directory,Item} that specifies a root directory for the added item.&nbsp; </p>\r\n<p>For your scenario, you might call ZipFile.AddDirectory(&quot;C:\\temp\\RepToZip&quot;, &quot;&quot;);&nbsp; </p>\r\n<p>or you might want ZipFile.AddDirectory(&quot;C:\\temp\\RepToZip&quot;, &quot;RepToZip&quot;);&nbsp; </p>\r\n<p>Consult the documentation for more information. &nbsp;</p>\r\n<p>There is more to the story, though. I originally created the zipit.exe utility as an example of how to use the library. It is necessarily an incomplete example - the library has capability that is not exposed through that utility. One of the things you cannot do within Zipit.exe is specify the DirectoryPath for the Add{File,Directory,Item} overload method. I can modify the zipit.exe to expose this capability, via a new command-line option, but I haven't done that yet. </p>\r\n<p>As a workaround, one way to get what you want with the existing zipit.exe is to change the current directory before zipping. For example:</p>\r\n<pre>  cd \\temp &amp;&amp; zipit.exe c:\\foo\\test.zip RepToZip &amp;&amp; cd \\foo \r\n</pre>\r\n",
    "PostedDate": "2008-08-06T10:58:45.213-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "109421",
    "ThreadId": "33014",
    "Html": "<p>Ok, I just added this capability to the zipit.exe example.</p>\r\n<p>it is now in changeset 21951 </p>\r\n<p><a href=\"http://www.codeplex.com/DotNetZip/SourceControl/DownloadSourceCode.aspx?changeSetId=21951\">http://www.codeplex.com/DotNetZip/SourceControl/DownloadSourceCode.aspx?changeSetId=21951</a> <br>\r\n<br>\r\nThis is in v1.6 preview and will be in the v1.6 final release. (Expected before the end of August). <br>\r\n<br>\r\nWith this change, using the -d argument on the zipit.exe command line,&nbsp;you can now specify the DirectoryPath that is used in the AddFile / AddDirectory / AddItem overload methods. </p>\r\n",
    "PostedDate": "2008-08-06T11:18:53.217-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  }
]