Hello,
It might be a simple issue, but I haven’t managed to solve myself. I am trying to delete some backups of former projects from the hard disk, but the process is interrupted and ends, because certain files “are in use”, according to the message that pops up. However, there’s no further information, apart of the files name. I have searched for a way to locate where they are used, but even by trying some tools suggested or other methods, I couldn’t solve this issue. Also, I’m not sure how to search for it in Unity’s forums, but I had no luck so far. I guess, it is not a common problem or it is just a simple one that I fail to resolve.
I was thinking, for example, that it might be the case, when files sometimes cannot be deleted, because they are used by the “open recent” quick file-opening method on some programs. Towards this, although it is not a totally similar case, I thought that there are projects listed at the “open project” dialog, but I don’t know how to remove them from this list, in order to test it.
Or would it be that some kind of unity’s library refers to them? (e.g. a cubemap file is one of the ‘problematic’ files)
Or else, maybe some script component is using these files (e.g. a text file is “in use”)? Although I’m not talking about the currently loaded project. I have even opened projects, which, for sure(?), are unrelated to the under discussion files, but still was not able to delete them.
Any ideas or suggestions, why or where they might be “in use” and how I could release them?
Thank you for reading!
It’s actually not related to Unity. Hopefully you have Unity / MonoDevelop closed when you try to delete the folder…
In use means that a program currently “works” on the file(s) in question. That means the program still has some files open so the OS doesn’t allow to delete the files. Possible reasons are:
- Antivirus software. Usually this shouldn’t be the case, but some might be bad programmed.
- Versioning software like SVN. SVN has a background service which handles actual syncing and the state icon for files folders.
- DropBox. You shouldn’t place a project directly into a dropbox synced folder. Since Dropbox permanently checks for updates and agressively tries to update the files.
- Sometimes the OS itself. When a filesystem journal is uses the OS might access the files for comparison / backup
The easiest way to find the process which still holds a filehandle is to use the Unlocker tool. It lists all processes that have a handle to a certain file. It’s also capable of releasing the lock. This might break the program using the file and might beak the files in use depending on what the process is doing with the file(s).
I return to revive a what should be considered a long forgotten and dead thread, but once again I came across to these damn ghost files that would prevent empty folders to be deleted. The time I spent, the effort, the research and all, were again similar. The difference, however, this time is that I found a cure to this disease. So, just for those 500+ people, who for any reason viewed this thread I hereby direct them to the forum, where, in a state of trance and relief for resolving the problem, I present the method that helped me.
By the way, Bunny was right from the beginning that it shouldn’t be a Unity-related issue.