{
  "WorkItem": {
    "AffectedComponent": {
      "Name": "",
      "DisplayName": ""
    },
    "ClosedComment": "",
    "ClosedDate": null,
    "CommentCount": 0,
    "Custom": null,
    "Description": "Ok let me try to explain it better.\n \nSuppose I have a zip file which contains: helloworld.txt test.txt\n \nNow suppose I try to extract this zipfile into a directory, c:\\Test .  What happens is, for each file in the zipfile the library creates a filename.ext.tmp while he unpacks the specific file of the ze.Extract. That means, when it extracts helloworld.txt on ze.Extract(...); in the folder c:\\test\\ there will be a file called helloworld.txt.tmp till extract finishes.\n \nA problem occurs when C:\\test already has a file called helloworld.txt.tmp .  If that happens, the library just fails with a message stating that the file already exists (the helloworld.txt.tmp, not  the helloworld.txt).",
    "LastUpdatedDate": "2017-06-19T13:48:00.207-07:00",
    "PlannedForRelease": "",
    "ReleaseVisibleToPublic": false,
    "Priority": {
      "Name": "Low",
      "Severity": 50,
      "Id": 1
    },
    "ProjectName": "DotNetZip",
    "ReportedDate": "2011-08-15T13:31:39.483-07:00",
    "Status": {
      "Name": "Proposed",
      "Id": 1
    },
    "ReasonClosed": {
      "Name": "Unassigned"
    },
    "Summary": "name clash possible with temporary file during extraction",
    "Type": {
      "Name": "Issue",
      "Id": 3
    },
    "VoteCount": 7,
    "Id": 14097
  },
  "FileAttachments": [],
  "Comments": [
    {
      "Message": "The code sample in this work item produces a zip with an invalid CRC:\r\n\r\nhttp://dotnetzip.codeplex.com/workitem/14087\r\n\r\nMight help reproduce the *.tmp file issue above.\r\n",
      "PostedDate": "2011-08-16T00:16:16.797-07:00",
      "Id": -2147483648
    },
    {
      "Message": "",
      "PostedDate": "2011-08-16T05:53:45.27-07:00",
      "Id": -2147483648
    },
    {
      "Message": "Added test routine here:\r\n\r\nhttp://dotnetzip.codeplex.com/discussions/268878",
      "PostedDate": "2011-08-16T07:27:12.367-07:00",
      "Id": -2147483648
    },
    {
      "Message": "",
      "PostedDate": "2012-03-05T04:43:11.4-08:00",
      "Id": -2147483648
    },
    {
      "Message": "",
      "PostedDate": "2012-05-29T07:20:31.697-07:00",
      "Id": -2147483648
    },
    {
      "Message": "Hello,\r\n\r\nI'm also running into this behavior. Are there any plans to update the code for this any time soon? Why not just create a .tmp file in a temp directory...?",
      "PostedDate": "2012-07-31T11:09:31.237-07:00",
      "Id": -2147483648
    },
    {
      "Message": "",
      "PostedDate": "2013-02-21T18:43:04.89-08:00",
      "Id": -2147483648
    },
    {
      "Message": "Hello,\r\n\r\nSame issue here.\r\n\r\nI added the following hack/workaround to our code until this issue is fixed in the Ionic library\r\n\r\nThe hack version:\n```\nusing (var zipFile = ZipFile.Read(filePath))\n{\n  foreach (var entry in zipFile.Entries)\n  {\n    var extractPath = Path.Combine(unzipPath, entry.FileName);\n    var extractTmpPath = string.Concat(extractPath, \".tmp\");\r\n\r\n    // Check if the temp file already exists\n    if (File.Exists(extractTmpPath))\n    {\n      // Remove the temp file\n      _Log.Info(\"Deleting existing temp file ({0}) to prevent problems with extraction.\", extractTmpPath);\n      File.Delete(extractTmpPath);\n    }\r\n\r\n    // Extract the actual file from the zip.\n    entry.Extract(unzipPath, ExtractExistingFileAction.OverwriteSilently);\n  }\n}\n```\r\n\r\nThe original code:\n```\nusing (var zipFile = ZipFile.Read(filePath))\n{\n  zipFile.ExtractAll(unzipPath, ExtractExistingFileAction.OverwriteSilently);\n}\n```",
      "PostedDate": "2013-05-02T11:29:29.52-07:00",
      "Id": -2147483648
    },
    {
      "Message": "",
      "PostedDate": "2013-07-23T09:37:29.387-07:00",
      "Id": -2147483648
    },
    {
      "Message": "",
      "PostedDate": "2013-09-24T09:48:46.633-07:00",
      "Id": -2147483648
    },
    {
      "Message": "",
      "PostedDate": "2014-01-10T03:10:34.11-08:00",
      "Id": -2147483648
    },
    {
      "Message": "I have faced this issue trying to unpack a lot of items into the one directory parallel. It seems like there was files with one name in some zips. So in spite of _ExtractExistingFileAction.OverwriteSilently_ option the conflict of _tmp_ filenames lead to the exception.",
      "PostedDate": "2014-01-10T03:29:01.777-08:00",
      "Id": -2147483648
    },
    {
      "Message": "The way the code is written, it can completely fail to extract to an empty directory if the zip archive as created contains adjacent files:\r\n\r\nx.txt\nx.txt.tmp\r\n\r\nThe failure occurs if x.txt.tmp is extracted first (not just a hypothetical scenario, hence I am commenting here).  Then when x.txt is to be extracted, x.txt.tmp already exists and the code throws on ZipEntry.Extract.cs line 770:\r\n\r\n                    output = new FileStream(targetFileName, FileMode.CreateNew);\r\n\r\nInstead of a simple \"add .tmp on the end\" to get a temporary file name, something less \"Cheesy\" is required. (Sorry.)\r\n\r\nSeems like the inability to extract files with the above pattern would warrant a higher impact than 'Low'.",
      "PostedDate": "2017-06-19T12:36:05.12-07:00",
      "Id": -2147483648
    },
    {
      "Message": "OK. Totally missed that this project moved to github. https://github.com/haf/DotNetZip.Semverd",
      "PostedDate": "2017-06-19T13:48:00.207-07:00",
      "Id": -2147483648
    }
  ]
}