I am creating a file, where I can store the game quality settings.
Here is the code:
The problem is, when I click on the back button, I get a "IOException: Sharing violation on path D:\Unity\Marble Worlds 2\Marble Worlds\config.txt". The file is created succesfully by another script, and it is there. Also, when I make a build from the game, the file is not rewrited. It writes new lines to the end of the file, rather than deleting the previous lines, and write the new line's to their place.
What is wrong with the code?
Thanks for your help.
asked Nov 18, 2011 at 10:33 AM
Should probably Close sr in readConfig. That would cause an error when you tried to open to write it (can't write to a file if someone is reading.)
answered Nov 19, 2011 at 05:59 AM
How to make a file and write to it in the same function, without getting the file share violation error. (I'm not sure if this is what Owen Reynolds meant, maybe i'm just saying the same thing)