home *** CD-ROM | disk | FTP | other *** search
- /* open a file, searching along the PATH environment variable for it */
-
- #include <stdio.h>
- #include <errno.h>
- #include <stdlib.h>
-
- FILE *
- fopenp(name, mode)
- char *name, *mode;
- {
- extern char *findfile();
- char *fullname;
-
- fullname = findfile(name, getenv("PATH"), (char **)0);
- if (!fullname) {
- errno = ENOENT;
- return NULL;
- }
- return fopen(fullname, mode);
- }
-