Declaration:
int searchpath(char file_name[], char path[]);
Description
Searches the operating system path for a file.
searchpath attempts to locate a file by searching along the operating system path specified by the PATH=... directive in the environment. The complete path-name string is stored in path. First, searchpath searches for the file in the current directory of the current drive. If the file is not found there, the PATH environment variable will be fetched and each directory in the path will be searched in turn until the file is found or the path is exhausted. If the file is located, the string with the full path name will be copied to path. This string can be used in a call to access the file (for example, with fopen).
searchpath returns TRUE on success, otherwise it returns FALSE.
|