- Home /
Duplicate Question of https://answers.unity.com/questions/1585681/how-do-i-write-to-a-created-file.html
How Do I Give Writing Permission of a Created File?
Hello, I'm working on a saving and loading system. In the system, you can create as many saves as you want, creating a new file for each save. First, I create the file using:File.Create(filePath);
The path is defined using:worldsFolder = Application.dataPath + "/WorldFolder"; string filePath = worldsFolder + "/" + worldName + ".world";
I created a string array with each line as a data set and tried to write to the file using:File.WriteAllLines(filePath, fileLines);
But when I click my save button in-game, an error shows up telling me stuff about file access, but I couldn't find any actually useful information on how to give me writing access. Help is greatly appreciated!
Follow this Question
Related Questions
How Do I Write to a Created File? 1 Answer
How to tell android to open a file 0 Answers
Will System.IO.File work on Macs 2 Answers
Does StreamReader work when porting to OSX? 1 Answer
Multiple Cars not working 1 Answer