im trying to use system.io to write to a text file. That is working… but i want to make it write to the file in the folder of the executable… so instead of having to put a full file path it will just check the root folder dynamically.
if (System.IO.File.Exists(@" ext.txt")) {
System.IO.File.AppendAllText(@" ext.txt", "my string...");
}
this doesnt work… obvisouly. How can I make it work?
Typically this is bad practice. Most operating systems want you to write in the documents folder (or equivalent). This can be accessed with Application.persistiantDataPath.
However if you know what you are doing then check Application.dataPath will work.