Finding out executable location from a c program
Clark S. Cox III
clarkcox3 at gmail.com
Mon Nov 19 21:37:24 PST 2007
In a word: yes.
CFBundle works in single-file executables as well as bundled
executables.
Clark Cox III
Clark.cox at apple.com
Sent from my iPhone
On Nov 19, 2007, at 21:31, Scott Stevenson <sstevenson at mac.com> wrote:
>
> 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
> _______________________________________________
> MacOSX-dev mailing list
> MacOSX-dev at omnigroup.com
> http://www.omnigroup.com/mailman/listinfo/macosx-dev
More information about the MacOSX-dev
mailing list