Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Turbo C - <b>searchpath() search the dos path</b> http://www.X-Hacker.org [<<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()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson