Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Borland C++ 2.x ( with Turbo C ) - <b>searchpath() search the ms-dos path</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 searchpath()            Search the MS-DOS Path

 #include   <dir.h>

 char       *searchpath(filename);
 const char *filename;                   Name of file to be searched for

    searchpath() uses the DOS path to search for the file specified by
    'filename'.  If the file is not found in the current directory of the
    current drive, searchpath() gets the PATH environment variable and
    searches each directory in the path until it either finds the file is
    found or has no more directories to check.

       Returns:     If the file is successfully located, searchpath()
                    returns a pointer to a 'filename' string. The string
                    contains the full path name and can be used to access
                    the file via a call to open() or exec...().  Because
                    the returned string is in a static buffer, it is
                    destroyed by a subsequent call to searchpath().

                    If the file is not located, searchpath() returns
                    NULL.

   Portability:     MS-DOS only.


See Also: exec...() open() system()

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