Search Unity

How to prevent the import of lockfiles?

Discussion in 'Editor & General Support' started by tswierkot, May 9, 2018.

  1. tswierkot

    tswierkot

    Joined:
    Feb 15, 2017
    Posts:
    25
    Right now in our Assets we have an Excel file named balance.xlsx. This file contains all the balance data for our game - damages, costs etc. This file is processed by a PostProcessor that reads data from it using the NPOI library and sets it in ScriptableObjects that use it in-game.

    The problem is this - when opening the Excel file, Excel creates a lockfile named ~$balance.xlsx. Unity attempts to import this file, but it can't - it does not have permission, so it displays an error dialog with 3 options - Try Again, Force Quit (quits Unity) and Cancel (stops the import of this file). Clicking Cancel during Play mode stops the game - this is undesired behaviour for us.

    Is there a way to prevent Unity from importing just these lockfiles, maybe something akin to git's .gitignore?
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,689
    Googling indicates you might be able to disable the creation of these lockfiles by Excel. Does that help?
     
  3. Xarbrough

    Xarbrough

    Joined:
    Dec 11, 2014
    Posts:
    1,188
    I have the same question, but after searching, I only found a couple of feature requests for Unity to ignore files selectively and a dozen questions about how to fix locked Excel files.

    There doesn't seem to be a way to stop Excel from creating these author/lock files other than editing the registry of the local machine. But that's no good when working in a team.

    It's too bad Unity doesn't ignore files that start with '~'. I mean, it ignores dots and files that end in '~', but Microsoft chose to use a prefix (which makes sense anyway).