Finding out executable location from a c program

Scott Stevenson sstevenson at mac.com
Mon Nov 19 21:31:22 PST 2007


On Nov 19, 2007, at 6:09 PM, Clark Cox wrote:

> Why bother with CFBundle's source? Just *use* CFBundle. (composed in
> e-mail, but should give a basic idea):
>
> #include <CoreFoundation/CFBundle.h>
> #include <stdlib.h>
> #include <stdio.h>
>
> char *GetExecutableLocation() {
>    CFBundleRef bundle          = CFBundleGetMainBundle();

I got the impression from the description that this is a program which  
does not necessarily have a bundle. Does CFBundle actually work some  
magic in that situation?

     - Scott


More information about the MacOSX-dev mailing list