Sender: hecht AT DH_NRZ24 DOT dillinger DOT de Message-ID: <3588FA4F.4487@dillinger.de> Date: Thu, 18 Jun 1998 14:30:23 +0300 From: Michael Hecht MIME-Version: 1.0 To: Eli Zaretskii CC: djgpp AT delorie DOT com Subject: Re: using redir References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Precedence: bulk Eli Zaretskii wrote: > > On Thu, 18 Jun 1998, Michael Hecht wrote: > > > Next question : Is there any command available like 'which' in UNIX ? > > You can easily write it yourself, using the library function > __dosexec_find_on_path. For example (untested!): > > #include > #include > #include > > int main (int argc, char *argv[]) > { > char full_path[FILENAME_MAX]; > extern char **environ; > > if (argc <= 1) > { > printf ("Usage: %s progname\n", argv[0]); > return 0; > } > > if (__dosexec_find_on_path (argv[1], (char **)0, full_path) == NULL && > __dosexec_find_on_path (argv[1], environ, full_path) == NULL) > printf ("%s: Command not found\n", argv[1]); > else > printf ("%s\n", full_path); > > return 0; > } Thank You, it works !!!