Reputation: 55
I have a very simple piece of code, It should work by detecting if a file exists and if so then delete the file. However when I run the code in the unity editor I get the following error: IOException: Sharing violation on path Assets\Plugins\Rooms Table.db
here is my code:
if(System.IO.File.Exists(@"Assets\Plugins\Rooms Table.db"))
{
System.IO.File.Delete(@"Assets\Plugins\Rooms Table.db");
}
Upvotes: 1
Views: 2357
Reputation: 55
I discovered the reason for my problem was that the folder containing my file was open in my code editor.
Upvotes: 1