Re: finding the full path of the program which ran.
- From: Grant Edwards <grante@xxxxxxxx>
- Date: Thu, 21 Dec 2006 22:24:55 -0000
On 2006-12-21, Joe Pfeiffer <pfeiffer@xxxxxxxxxxx> wrote:
John Reiser <jreiser@xxxxxxxxxxxx> writes:
I m building a library which requires the full path of the program to
which it is linked. How could I do it?
This is impossible if you require an answer that is always correct
regardless of circumstances.
The presence of hard links and symbolic links allows for many different
names for the "same" program. So "_the_ full path" might be ambiguous.
(snipped lots of good information)
Never mind that the full path at link time isn't likely to be the same
as the full path at run time.
Well, he did say "is linked" rather than "was linked", so I
assumed he wanted the current path of the current executable in
who's context the library is executing.
There isn't really a good, general way to find out. Most
people who want to know are asking for the wrong reasons
anyway. Usually when people ask "how do I find the location of
the program's exectuable" it's becuase they're Windows
programmers who think configuration files are stored in the
same directory as executables.
Under Unix that's most definitely _not_ where configuration
files go, so there shouldn't be any real need to know.
--
Grant Edwards grante Yow! Jesuit priests are
at DATING CAREER DIPLOMATS!!
visi.com
.
- Follow-Ups:
- Re: finding the full path of the program which ran.
- From: phil-news-nospam
- Re: finding the full path of the program which ran.
- From:
- Re: finding the full path of the program which ran.
- References:
- finding the full path of the program which ran.
- From: Prasad
- Re: finding the full path of the program which ran.
- From: John Reiser
- Re: finding the full path of the program which ran.
- From: Joe Pfeiffer
- finding the full path of the program which ran.
- Prev by Date: disabling sockets for running processes
- Next by Date: Re: If pipe excellent?
- Previous by thread: Re: finding the full path of the program which ran.
- Next by thread: Re: finding the full path of the program which ran.
- Index(es):
Relevant Pages
|