Save to iPhone

Has anyone had success on saving a text file on the iPad? I’m 99% sure I’m doing this correct, and it is not working. For example, the exact same pseudo code works fine on the computer, but not on the iPhone.

import System; 
import System.IO; 
private var writer : System.IO.StreamWriter;
var docPath : String;

function SaveDots (nameOfClient : String, blueDots : GameObject[], yellowDots : GameObject[]) {
	// Get name of the file
	nameOfClient = nameOfClient + ".txt";
	
	// Get docPath
	docPath = Application.dataPath.Substring(0, Application.dataPath.Length - 4) + "Documents"; 

	writer = new StreamWriter(docPath + "/test.txt");
	writer.WriteLine("jandkjasd");
	writer.Close();

}

I am compiling for iPhone OS 3.2, targe device iPhone + iPad, .Net 1.1, with no Unity networking.

Using the debugger, I get the error :

DirectoryNotFoundException: Could not find a part of the path "/var/mobile/Applications/THISISMYIPADID(I hid it for security reasons, but it's like IASDS-289232, etc.)/board.app/Documents/test.txt".
System.IO.StreamWriter..ctor (System.String path)

SOLVED

Thanks, this helped me out!

i know this is an old post,

but i cant seem to get this working, im trying to save a screenshot PNG to the documents folder

my script is here

http://forum.unity3d.com/threads/73449-is-Application.CaptureScreenshot-possible?p=470296&posted=1#post470296

any help?