Uploaded image for project: 'Lucy'
  1. Lucy
  2. LUCY-254

Creation of Charmonizer temp files sometimes fails on Windows

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.4.0
    • Component/s: Charmonizer
    • Labels:
      None

      Description

      On Windows, a file won't be deleted until every open handle on it is closed. So if a file is deleted and immediately recreated with the same filename, the creation fails if another process (typically a virus scanner) still has an open handle on it. The solution is to create temporary files with unique names. I propose to add the following function to OperatingSystem.c and use it for every temp file:

      char*
      chaz_OS_temp_filename(const char *prefix, const char *ext);
      

      It should simply add a number to the filename which is incremented on every call to that function.

      (Currently, the effect is that Charmonizer occasionally fails in chaz_Util_remove_and_verify. This kind of verification isn't reliable on Windows.)

        Attachments

          Activity

            People

            • Assignee:
              marvin Marvin Humphrey
              Reporter:
              nwellnhof Nick Wellnhofer
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: