gcl-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gcl-devel] Re: Getting full pathname of running executable


From: Aurelien Chanudet
Subject: [Gcl-devel] Re: Getting full pathname of running executable
Date: Wed, 10 Sep 2003 10:33:17 +0200 (CEST)

Hi,

There are several alternatives on Mac OS X.

>   int p;
>   char b[PATH_MAX],q[PATH_MAX];
> 
>   p=getpid();
>   snprintf(q,sizeof(q),"/proc/%d/exe",p);
>   realpath(q,b);

#include <mach-o/dyld.h>
_NSGetExecutablePath(b,PATH_MAX);

Aurelien

___________________________________________________________
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en fran├žais !
Yahoo! Mail : http://fr.mail.yahoo.com




reply via email to

[Prev in Thread] Current Thread [Next in Thread]