{
  "WorkItem": {
    "AffectedComponent": {
      "Name": "",
      "DisplayName": ""
    },
    "ClosedComment": "",
    "ClosedDate": null,
    "CommentCount": 0,
    "Custom": null,
    "Description": "From http://dotnetzip.codeplex.com/Thread/View.aspx?ThreadId=234678\n \nhere's the background:\n \nWhen calling {Add,Update}SelectedFiles(), the library does not add directories into the zip that are empty in the filesystem, and does not add directories into the zip which do not contain files satisfied by the selection criteria. This behavior was by design, arbitrarily decided by Cheeso. The thinking at the time was that the {Add,Update}SelectedFiles methods were dealing with files, and if there were no files in a directory then the directory wouldn't get added.  It turns out this behavior is surprising to some people.\n \nConsider the possibilities.  \n \nCase 1: In the case of an empty directory, and a file criterion that selects files by name.  In this case, some users might prefer that the directory not be included in the library, and some might prefer the other way.  \n \nCase 2: imagine a directory in the filesystem that is not empty, yet the file selection criteria doesn't match for any file in the directory.  Should *that* directory be added to the zip?   \n \nCase 3: Suppose there is a nested directory structure in the filesystem, nested 10 levels deep, and none of the files in that directory subtree are selected with the criteria.  Should this entire directory subtree be replicated into the zip file, empty, with no files in any of these subdirs? \n \nI thought a little about how a developer might express just what he desires here, but I didn't come up with an easy, elegant solution, meaning easy to explain and understand and use.  So I'm still thinking about that.\n \n-----\n \nI understand that UpdateSelectedFiles is clearly intended for files only. \n \nBut, it would be nice to be able to add files from the filesystem, while also adding empty directories from the directory tree.\n \nConsider whether adding a new feature to this method will satisfy.  If that doesn't work, then update the documentation to explicitly describe the existing behavior.\n \nAlso - How does AddDirectory() behave in the face of empty directories in the tree?",
    "LastUpdatedDate": "2013-02-21T18:43:21.54-08:00",
    "PlannedForRelease": "",
    "ReleaseVisibleToPublic": false,
    "Priority": {
      "Name": "Low",
      "Severity": 50,
      "Id": 1
    },
    "ProjectName": "DotNetZip",
    "ReportedDate": "2010-11-20T05:46:40.377-08:00",
    "Status": {
      "Name": "Proposed",
      "Id": 1
    },
    "ReasonClosed": {
      "Name": "Unassigned"
    },
    "Summary": "Handle empty directories explicitly in {Add,Update}SelectedFiles",
    "Type": {
      "Name": "Issue",
      "Id": 3
    },
    "VoteCount": 1,
    "Id": 12542
  },
  "FileAttachments": [],
  "Comments": [
    {
      "Message": "[quote]Now imagine a directory in the filesystem that is not empty, yet the file selection criteria doesn't match for any file in the directory.  Should *that* directory be added to the zip?   Now take it a step further. Suppose there is a nested directory structure in the filesystem, nested 10 levels deep, and none of the files in that directory subtree are selected with the criteria.[/quote]\r\n\r\nAlthough I sense your comment was philosophical/rhetorical in nature, I will attempt to inject my opinion on each matter, and why I feel that way. It certainly is biased, but it does seem \"logical\" to me.\r\n\r\n\r\n\r\n\r\n\r\n[quote]Now imagine a directory in the filesystem that is not empty, yet the file selection criteria doesn't match for any file in the directory.  Should *that* directory be added to the zip?[/quote]\r\n\r\nI feel that \"UpdateSelectedFiles\" would imply that files/folders would only be added explicitly. The object is updated because you specified that it needs to be updated.\r\n\r\nIf \"directory1\" is an empty folder, it should be added under these conditions:\r\n(name = *.*) - explicity telling DNZ to add everything.\r\n(name = '*\\directory\\*.abc') - explicitly telling DNZ to add folder with all .abc files (regardless of their presence).\r\n\r\n\r\nIf \"directory1\" has items in it (lets say it is a folder with nothing but .txt files), but nothing that meets your criteria:\r\n(name = '*\\directory\\*.abc') - Your criteria does not match any files in this folder, folder should be added to zip, but remain empty, because you specified explicity that DNZ needs to check that folder.\r\n\r\n\r\n\r\n\r\n\r\n[quote]Now take it a step further. Suppose there is a nested directory structure in the filesystem, nested 10 levels deep, and none of the files in that directory subtree are selected with the criteria.  Should this entire directory subtree be replicated into the zip file, empty, with no files in any of these subdirs?[/quote]\r\n\r\n\r\n(name = '*\\directory\\nest1\\nest2\\nest3\\nest4\\nest5\\*.abc') - Add all of these folders. This is consistent with my response above.\r\n\r\nBut if you do not explicity specify that DNZ needs to check for *.abc files within that nesting structure, do not add them.\r\n\r\n\r\n\r\n\r\n\r\n\r\nAs a (noob) developer myself, I've found that adding options is a good thing, but at the same time, can make your code harder to manage and make bugs harder to find. Perhaps you could make a new method to deal with this logic, something like:\r\n\r\n\r\nZip.ReplicateFolderStructure = True\r\n\r\n\r\nThis could address the behavior you specified, and at the same time, maybe wouldn't require fundamental changes in UpdateSelectedFiles. I don't know though; without knowing how DotNetZip is coded, it's impossible to say what the easiest, most sweeping solution would be. But having options is always a good thing.",
      "PostedDate": "2010-11-20T08:23:14.237-08:00",
      "Id": -2147483648
    },
    {
      "Message": "",
      "PostedDate": "2011-08-01T14:06:51.79-07:00",
      "Id": -2147483648
    },
    {
      "Message": "",
      "PostedDate": "2011-08-01T14:17:20.46-07:00",
      "Id": -2147483648
    },
    {
      "Message": "",
      "PostedDate": "2011-08-01T14:18:34.23-07:00",
      "Id": -2147483648
    },
    {
      "Message": "",
      "PostedDate": "2011-08-01T14:19:48.407-07:00",
      "Id": -2147483648
    },
    {
      "Message": "",
      "PostedDate": "2013-02-21T18:43:21.54-08:00",
      "Id": -2147483648
    }
  ]
}