OPENPATH
Section: C Library Functions (3)
Index
Return to Main Contents
NAME
openpath - open a file, searching through a search path
SYNOPSIS
FILE *openpath(fname, mode, path)
char *fname;
char *mode;
char *path;
extern char *DefaultPath;
DESCRIPTION
openpath
opens a file like
fopen(3),
except it uses a search path.
A FILE pointer is returned for the first file matching the name
that could be opened
in the search path.
If no file name matches,
FILENULL is returned.
The
mode
is passed directly to
fopen(3).
The
path
is a colon-separated list of possible directories.
Each element of the path can begin with a tilde (``~'')
to interpolate the
$HOME
environment variable.
Zero length entries indicate the current directory.
If the path is not specified (CHARNULL),
the external variable
DefaultPath
is used.
This is set from the
$ROOTPATH
environment variable.
If this is not set, a system default is used,
usually ``/usr/local:/usr:~:''.
SEE ALSO
fopen(3)
AUTHOR
Eric Allman, University of California, Berkeley
Index
- NAME
-
- SYNOPSIS
-
- DESCRIPTION
-
- SEE ALSO
-
- AUTHOR
-
This document was created by
man2html,
using the manual pages.
Time: 10:08:10 GMT, December 12, 2024