[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
searchpath() Search the DOS Path
#include <dir.h>
char *searchpath(filename);
char *filename; Name of file to be searched for
searchpath() searches for the file 'filename' using the MS-DOS path.
The current directory of the current drive is checked first. If the
file is not found there, the PATH environment variable is fetched.
Each directory in the path is searched until the file is found or the
path is exhausted.
Returns: If the file is successfully located, a pointer to a
'filename' string is returned. The string contains the
full path name and can be used in a call to open() or
exec...() to access the file. The returned string is
located in a static buffer and so is destroyed on each
subsequent call to searchpath().
If the file is not located, searchpath() returns NULL.
See Also:
exec...()
open()
system()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson