currentDirectoryPath does not work
currentDirectoryPath does not work
- Subject: currentDirectoryPath does not work
- From: James Ludtke <email@hidden>
- Date: Mon, 23 Jun 2003 13:57:25 -0400
I am trying to read and write from my application to a file that is in the
same folder as my application. because I can not be certain where a user may
put the folder, I do not know the absolute path. The following code works
when I run my application from within the Project Builder, but fails when I
run the compiled application. The compiled application reads from and writes
to root. This includes the application in the build folder.
myPath = [[NSFileManager defaultManager] currentDirectoryPath];
myFile = @"dsf.txt";
myFilePath = [myPath stringByAppendingPathComponent: myFile];
myStatusString = [NSString stringWithContentsOfFile: myFilePath];
I also tried the Unix relative path method, e.g,
myPath = @"./"
This also works from within Project Builder but again fails from the
compiled application.
Is this a bug in Cocoa, or what am I doing wrong?
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.