Re: Find app's working directory
Re: Find app's working directory
- Subject: Re: Find app's working directory
- From: Sherm Pendley <email@hidden>
- Date: Mon, 5 Jan 2004 11:03:52 -0500
On Jan 5, 2004, at 10:11 AM, Sam Carr wrote:
On 5 Jan 2004, at 2:43 pm, Chad Armstrong wrote:
Perhaps I'm just remembering something, but I'm trying to retrieve
the current running directory of my application.
You should be able to use:
NSString *appPath = [NSBundle mainBundle];
Perhaps I'm mis-interpreting the question, but I don't think that's
what Chad is after. That will give the path to the .app wrapper, but it
appears to me that Chad wants the current working directory. In other
words, he wants the directory from which relative paths will be
resolved.
The answer to *that* question is "/" when your app is started from
Finder, and the build directory when it's started from PB/XCode. As far
as I know, neither is guaranteed, so the best thing to do is to specify
fully-qualified paths.
sherm--
_______________________________________________
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.