prev up next   top/contents search

comp.lang.c FAQ list · Question 19.31

Q: How can my program discover the complete pathname to the executable from which it was invoked?

A: argv[0] may contain all or part of the pathname, or it may contain nothing. You may be able to duplicate the command language interpreter's search path logic to locate the executable if the name in argv[0] is present but incomplete. However, there is no guaranteed solution.

References: K&R1 Sec. 5.11 p. 111
K&R2 Sec. 5.10 p. 115
ISO Sec.
H&S Sec. 20.1 p. 416

prev up next   contents search
about this FAQ list   about eskimo   search   feedback   copyright

Hosted by Eskimo North