
Click above to get retro games delivered to your door ever month!
X-Hacker.org- libc - <b>searchpath</b>
[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
searchpath
==========
Syntax
------
#include <dir.h>
char * searchpath(const char *file);
Description
-----------
Given a name of a file in FILE, searches for that file in a list of
directories, including the current working directory and those defined
in the PATH environment variable.
Return Value
------------
When successfull, the function returns a pointer to a static buffer
where the full pathname of the found file is stored. Otherwise, it
returns NULL.
Example
-------
printf("%s was found as %s\n", argv[1], searchpath(argv[1]));
Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson