Re: finding the full path of the program which ran.



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.
--
Joseph J. Pfeiffer, Jr., Ph.D. Phone -- (505) 646-1605
Department of Computer Science FAX -- (505) 646-1002
New Mexico State University http://www.cs.nmsu.edu/~pfeiffer
.