title: Text file read/write in Unity for iOS
body: <p>I am trying to get text file read/write access at Unity for iOs project.
  What I did was</p>
  
  <pre><code>        //Read
          StreamReader reader = new StreamReader(Application.persistentDataPath + "/record.txt"); 
          string record = reader.ReadToEnd ();
          string[] records = record.Split(new string[] { " " }, StringSplitOptions.None);
          firstname = records [0]; lastname = records [1]; loginName = records [2]; password = records [3];
          reader.Close();
          email.transform.GetComponent&lt;InputField&gt; ().text = loginName;
          pwd.transform.GetComponent&lt;InputField&gt; ().text = password;
  
  
          //Write
  
          File.WriteAllText(Application.persistentDataPath + "/record.txt", String.Empty);
          //File.Create (Application.persistentDataPath + "/record.txt").Close ();
          StreamWriter writer = new StreamWriter (Application.persistentDataPath + "/record.txt", true);
          writer.WriteLine (Login.firstname + " " + Login.lastname + " " + Login.loginName + " " + Login.password);
          writer.Close ();
  </code></pre>
  
  <p>Then I include the file to Build Phases -> Copy Bundle Resources, so the file is inside the project.
  But when I run the app inside the device, I can't read file and got message as </p>
  
  <pre><code>IsolatedStorageException: Could not find file "/var/mobile/Containers/Data/Application/D48E51C7-F2EE-48CF-9B84-6602CE135EBC/Documents/record.txt".
    at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options) [0x00000] in &lt;filename unknown&gt;:0 
    at System.IO.File.OpenRead (System.String path) [0x00000] in &lt;filename unknown&gt;:0 
  </code></pre>
  
  <p>What could be wrong?</p>