Mail Archives: djgpp/2000/08/21/11:03:40
> Date: Mon, 21 Aug 2000 15:32:11 +0200
> From: Waldemar Schultz <schultz AT mathematik DOT tu-muenchen DOT de>
>
> Eli Zaretskii schrieb:
> >
> > There is a library function which will do all this: it's called
> > __dosexec_find_on_path.
>
> Could you please show how to use it - I can't find it in the docs.
That's an omission; please feel free to contribute.
__dosexec_find_on_path's usage is like this:
char *__dosexec_find_on_path(const char *program, char *envp[], char *buf);
You pass a program name in PROGRAM, the environment array in ENVP
(usually the global variable `environ', but you could, for example,
pass NULL, if you don't want it to look along the PATH, but only in
the current directory). If the function finds the program, with or
without one of the known executable extensions, either in the current
directory or along the PATH as recorded in ENVP[], it puts the full
pathname into BUF and returns a pointer to BUF. Otherwise, it returns
NULL.
- Raw text -