[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gcl-devel] Getting full pathname of running executable
From: |
Camm Maguire |
Subject: |
[Gcl-devel] Getting full pathname of running executable |
Date: |
09 Sep 2003 21:19:06 -0400 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 |
This nonportable proc dependant code is the best I can think of at the
moment. Alternatives, esp. on Windows/Mac?
int p;
char b[PATH_MAX],q[PATH_MAX];
p=getpid();
snprintf(q,sizeof(q),"/proc/%d/exe",p);
realpath(q,b);
Take care,
--
Camm Maguire address@hidden
==========================================================================
"The earth is but one country, and mankind its citizens." -- Baha'u'llah
[Gcl-devel] FreeBSD port (Was: Re: NetBSD/sparc port?), Mark Murray, 2003/09/11