Finding where an executable was run from -- a proposal.
Johan Vromans
jv at mhres.mh.nl
Fri May 13 04:58:33 AEST 1988
>From article <4527 at hoptoad.uucp>, by gnu at hoptoad.uucp (John Gilmore):
> If anyone implements this, I recommend providing a #define AV_EXECNAME -1
> and documenting that argv[AV_EXECNAME] is the pathname given to exec().
I'm already using the convention that library/data files belonging to a
program are located in a path relative to the name of the program. So I
strongly second this suggestion. Until this is adopted by the next C
standard, we'll need to have a library routine which does the job, based on
argv[0] and the PATH variable (despite of the possible problems - there's
no better way).
--
Johan Vromans | jv at mh.nl via European backbone
Multihouse N.V., Gouda, the Netherlands | uucp: ..{uunet!}mcvax!mh.nl!jv
"It is better to light a candle than to curse the darkness"
More information about the Comp.unix.wizards
mailing list