Re: Find app's working directory
Re: Find app's working directory
- Subject: Re: Find app's working directory
- From: Douglas Davidson <email@hidden>
- Date: Mon, 5 Jan 2004 10:16:39 -0800
On Jan 5, 2004, at 7:11 AM, Sam Carr wrote:
NSString *appPath = [NSBundle mainBundle];
Er, [[NSBundle mainBundle] bundlePath] for the path to the app itself,
then if you wish use stringByDeletingLastPathComponent to get the
directory it lives in. However, that's where the app lives, which is
not what is usually called the "working directory". The latter term
usually refers to the current working directory, which is
[[NSFileManager defaultManager] currentDirectoryPath]. Cocoa apps
usually do not need to refer to the cwd; it's primarily for
command-line tools, which often use it as an implicit argument. The
cwd and the app's path have no necessary connection.
Douglas Davidson
_______________________________________________
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.