Re: how to get the location of a program
Re: how to get the location of a program
- Subject: Re: how to get the location of a program
- From: Peter Bierman <email@hidden>
- Date: Tue, 19 Apr 2005 17:42:53 -0700
At 4:10 PM -0700 4/19/05, w.o.b wrote:
Hi,
Is there a way in OS X to get the full path of a
program where it's being executed?
I need to know the location where the user stores my
program (along with some configuration files), to set
up its running environment.
Look at NSBundle
http://developer.apple.com/documentation/Cocoa/Reference/Foundation/ObjC_classic/Classes/NSBundle.html
You can get your app bundle path with
NSString *path = [[NSBundle mainBundle] bundlePath];
For resources, use the other NSBundle APIs to find them. NSBundle can
handle finding things by name, file extension, and localization.
-pmb
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden