How to write subfolders to PersistentDataPath iOS

So at runtime I need to be able to store downloaded data on the iOS device so I can use at later times. I want to keep things organized so I don’t have to use a weird naming convention.

How can I create a subdirectory in Application.PersistentDataPath for iPhone?

I thought I could do something like this but I get a error through xcode saying it can’t find the directory.

string path = Application.persistentDataPath +"/localData/" + character.Name + ".xml";
StreamWriter fileWriter = File.CreateText(path);
fileWriter.WriteLine("Hello world");


Thanks danny but I a different way to do it and forgot to update this.

Here’s what I did if anyone needs to know

DirectoryInfo dirInf = new DirectoryInfo(Application.persistentDataPath + “/” + “localPet”);
Debug.Log (“Creating subdirectory”);


string path = Application.dataPath + "/Raw/" + fileName;