{
  "WorkItem": {
    "AffectedComponent": {
      "Name": "",
      "DisplayName": ""
    },
    "ClosedComment": "fixed in changeset 53121.  First binary 1.9.0.34",
    "ClosedDate": "2009-12-27T00:43:26.747-08:00",
    "CommentCount": 0,
    "Custom": null,
    "Description": "Hi,\n \nI'm currently using DotNetZip version 1.9 beta.\n \nI'm using a bunch of threads to zip different files at the same time. There is no problem when the files are in different folders, but when two files are located in the same folder, I sometimes get the IOException :\n \n\"The file '<SomePath>\\DotNetZip-aaaaaaaa.tmp' already exists.\"\n \nThe first problem resides in the fact that the file name is generated using a System.Random object, and it is not thread-safe. When the _rdn attribute is accessed by more than one thread, it may become corrupted, and _rdn.Next() will always return 0. This explains why the filename ends with As. This can be solved very easily using a lock on the _rdn attribute before calling Next().\n \nThe second problem is the fact that the generated name is validated using File.Exists() to ensure there is no conflicting file name. This is not enough to verify the uniqueness of the file name since the file may be created between the File.Exists() call and the new FileStream() call. I suggest using System.IO.Path.GetTempFileName() to get a temporary file, or to open the FileStream within the GetTempFilename() method.\n \nLocation of the code: \\DotNetZip-src-v1.9.0.32\\DotNetZip\\Zip Partial DLL\\Shared.cs\n \nRegards,\n \nPatrick",
    "LastUpdatedDate": "2013-05-16T05:31:57.243-07:00",
    "PlannedForRelease": "",
    "ReleaseVisibleToPublic": false,
    "Priority": {
      "Name": "Low",
      "Severity": 50,
      "Id": 1
    },
    "ProjectName": "DotNetZip",
    "ReportedDate": "2009-12-21T14:58:29.58-08:00",
    "Status": {
      "Name": "Closed",
      "Id": 4
    },
    "ReasonClosed": {
      "Name": "Unassigned"
    },
    "Summary": "Multi-threading issue with GetTempFilename()",
    "Type": {
      "Name": "Issue",
      "Id": 3
    },
    "VoteCount": 1,
    "Id": 9763
  },
  "FileAttachments": [],
  "Comments": [
    {
      "Message": "Patrick, thanks for the report.  I understand what you wrote.  I think there's a better, more reliable way to go.\r\nI'd like to make sure.  Can you give me the full stack trace you see with the IOException?\r\nThanks. ",
      "PostedDate": "2009-12-26T20:29:09-08:00",
      "Id": -2147483648
    },
    {
      "Message": "",
      "PostedDate": "2009-12-27T00:43:26.747-08:00",
      "Id": -2147483648
    },
    {
      "Message": "Why was this issue closed with no resolution? This is still a problem in a concurrent environment. If a solution was applied please share it. \r\n\r\nIs there a way for me to specify the name of the *.tmp file for the extract process to be used? \r\n\r\nI'm trying to work through the issue using the ExtractProgress event. Specifically tried the flags\nZipProgressEventType.Extracting_BeforeExtractEntry\nZipProgressEventType.Extracting_AfterExtractEntry:\r\n\r\nbut it doesn't work. \r\n\r\nIn a concurrent processing environment this is a big issue. Please advise.... Thank you",
      "PostedDate": "2013-01-14T20:56:40.603-08:00",
      "Id": -2147483648
    },
    {
      "Message": "",
      "PostedDate": "2013-02-21T18:43:45.46-08:00",
      "Id": -2147483648
    },
    {
      "Message": "",
      "PostedDate": "2013-05-16T05:31:57.243-07:00",
      "Id": -2147483648
    }
  ]
}