Date: Thu, 18 Jun 1998 15:09:31 +0300 (IDT) From: Eli Zaretskii To: Michael Hecht cc: djgpp AT delorie DOT com Subject: Re: using redir In-Reply-To: <3588EAD1.2F1C@dillinger.de> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk 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; }