title: Zip Archive: Entry name problems
body: <p>I experienced two problems with the zip archive which I want to share here and ask for your experience as well:</p>
  
  <ol>
  <li><p>Duplicate directories
  If I create two or more directories of the same name in the archive(below the root) the archive contains both directories (when looking in the Entries) but every ZIP-Application (also Windows) shows me only one directory. I did it like this:</p>
  
  <pre><code>using (ZipArchive a = ZipFile.Open("D:\\zip.zip", ZipArchiveMode.Update))
  {
      ZipArchiveEntry e1 = a.CreateEntry("dir1/");
      ZipArchiveEntry e2 = a.CreateEntry("dir1/");
  
      foreach (var afile in a.Entries)
      {
          Console.WriteLine(afile.FullName);
      }
  }
  </code></pre></li>
  </ol>
  
  <p>The level itself doesn't matter, also if I go one level down ("dir1/dir2/") the same happens.</p>
  
  <ol start="2">
  <li><p>Missing entries
  By mistake I put a slash as the first character of a directory or filename. Both entries are visible also in the Entries property, but are also not visible on ZIP-applications (also Windows):</p>
  
  <pre><code>using (ZipArchive a = ZipFile.Open("D:\\zip.zip", ZipArchiveMode.Update))
  {
      ZipArchiveEntry e1 = a.CreateEntry("/dir1");
      ZipArchiveEntry e2 = a.CreateEntry("/dir1.txt");
  
      foreach (var afile in a.Entries)
      {
          Console.WriteLine(afile.FullName);
      }
  }
  </code></pre></li>
  </ol>
  
  <p>Have any of you ever experienced this problem? Is it only a problem that ZIP can do it, but no application is able to display it, or is this a mistake that is not properly handled by the creation routines?</p>
  
  <p>Thanks
  Martin</p>