{
  "WorkItem": {
    "AffectedComponent": {
      "Name": "",
      "DisplayName": ""
    },
    "ClosedComment": "",
    "ClosedDate": null,
    "CommentCount": 0,
    "Custom": null,
    "Description": "In the following code when I use zipFile.AddDirectoryByName(newPath); it's creating both an empty folder in the archive but also a zero sized file.\n\nI think this is a bug in DotNetZip but if you spot something wrong in my code that'd be just as good of a fix.\n\n```\n        private static void RecursiveAddToZip(ZipFile zipFile, FolderData folderData, string path = \"\")\n        {\n            string newPath = path + \"/\" + folderData.Name;\n\n            // add this folder\n            zipFile.AddDirectoryByName(newPath);\n\n            // add files\n            foreach (FileData data in folderData.Files)\n            {\n                ZipEntry zipEntry = zipFile.AddFile(data.FullPath, newPath);\n                zipEntry.FileName = Path.Combine(Path.GetDirectoryName(zipEntry.FileName) ?? \"\", data.Name);\n            }\n\n            // add folders\n            foreach (FolderData data in folderData.Folders)\n                RecursiveAddToZip(zipFile, data, newPath);\n        }\n```",
    "LastUpdatedDate": "2015-09-23T17:46:27.953-07:00",
    "PlannedForRelease": "",
    "ReleaseVisibleToPublic": false,
    "Priority": {
      "Name": "Unassigned",
      "Severity": 0,
      "Id": 0
    },
    "ProjectName": "DotNetZip",
    "ReportedDate": "2015-02-26T17:15:07.707-08:00",
    "Status": {
      "Name": "Proposed",
      "Id": 1
    },
    "ReasonClosed": {
      "Name": "Unassigned"
    },
    "Summary": "ZipFile.AddDirectoryByName creating zero sized file",
    "Type": {
      "Name": "Unassigned",
      "Id": 5
    },
    "VoteCount": 1,
    "Id": 17377
  },
  "FileAttachments": [],
  "Comments": [
    {
      "Message": "I agree it should be considered a bug.\r\n\r\nHowever, looking at a ZipOutputStream which only has a PutNextEntry(string) method, but no directory- or file-specific method, I wonder if adding a trailing (back)slash to the directory names (which is how PutNextEntry distinguishes a file entry from a directory entry) might work as a workaround for you.",
      "PostedDate": "2015-09-23T17:46:27.953-07:00",
      "Id": -2147483648
    }
  ]
}