Re: POSIX equiv to [nsBundle mainBundle] bundlePath]
Re: POSIX equiv to [nsBundle mainBundle] bundlePath]
- Subject: Re: POSIX equiv to [nsBundle mainBundle] bundlePath]
- From: "tobias ford..." <email@hidden>
- Date: Fri, 25 Jul 2003 16:51:55 -0500
Thanks. I hadn't seen that example. It's really close to what I'm
desiring.
Jaguar and above define _NSGetExecutablePath in the System framework.
It's a snap if you will be linking Foundation already, but if you
don't go that route
their is a straight C solution in sample code on Apple's site.
The solution they present is not portable to other unix flavors, but
is the most efficient
way for OSX.
I am unaware of a portable approach which does not insist you be
called first,
This one relies on exec stashing a copy of the executables path
immediately
after the trailing NULL of envp.
http://developer.apple.com/samplecode/Sample_Code/Security/AuthSample/
getpath.c.htm
I don't recall if it this path contains symlinks, if it does, a call
to realpath(3) will
normalize for you.
-------------------
Tobias Ford...
email@hidden email@hidden
-------------------
Senior Software Engineer @ WolfPack Studios
www.wolfpackstudios.com www.shadowbane.com
_______________________________________________
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.