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.

Seealso:



This page last updated on Fri Nov 30 10:48:32 MSK 2001
Copyright © 1992-2001, Vitaly Filatov, Moscow, Russia
Webmaster