gcl-devel
[Top][All Lists]
Advanced

[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




reply via email to

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