Date: Mon, 21 Aug 2000 18:05:53 +0200 From: "Eli Zaretskii" Sender: halo1 AT zahav DOT net DOT il To: schultz AT mathematik DOT tu-muenchen DOT de Message-Id: <8582-Mon21Aug2000180553+0300-eliz@is.elta.co.il> X-Mailer: Emacs 20.6 (via feedmail 8.2.emacs20_6 I) and Blat ver 1.8.5b CC: djgpp AT delorie DOT com In-reply-to: <39A12F5B.E165D025@ma.tum.de> (message from Waldemar Schultz on Mon, 21 Aug 2000 15:32:11 +0200) Subject: Re: DJGPP port of WHICH References: <44An5.13355$Gs DOT 66133 AT news4 DOT atl> <7QWn5.142399$Fw6 DOT 3484407 AT afrodite DOT telenet-ops DOT be> <5567-Mon21Aug2000143151+0300-eliz AT is DOT elta DOT co DOT il> <39A12F5B DOT E165D025 AT ma DOT tum DOT de> Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > Date: Mon, 21 Aug 2000 15:32:11 +0200 > From: Waldemar Schultz > > 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.