Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string path = GetiPhoneDocumentsPath();
- if (System.IO.File.Exists(path) == false) XmlTextWriter textWriter = new XmlTextWriter(path,null);
- public static string GetiPhoneDocumentsPath()
- {
- // Your game has read+write access to /var/mobile/Applications/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/Documents
- // Application.dataPath returns
- // /var/mobile/Applications/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/myappname.app/Data
- // Strip "/Data" from path
- string path = Application.dataPath.Substring(0, Application.dataPath.Length - 5);
- // Strip application name
- path = path.Substring(0, path.LastIndexOf('/'));
- return path + "/Documents/myFile.xml";
- }
- FileInfo info = new FileInfo(path);
- if (info == null || info.Exists == false) { ... };
Add Comment
Please, Sign In to add comment