fcfgopen()
Open a configuration file
Synopsis:
#include <cfgopen.h>
FILE * fcfgopen( const char * path,
const char * mode,
int location,
const char * historical,
char * namebuf,
size_t nblen );
Arguments:
- path
- The name of the configuration file that you want to open.
- mode
- A string that describes the mode to open in; see fopen().
- location
- Flags that describe how the path is constructed.
See
Search condition flags
in the documentation for cfgopen(). - historical
- A optional file to open as a last resort if none of the criteria for finding the path is met.
This string works like a path search order, and lets you search more than one location.
You can also specify
%Hto substitute the hostname value into the string. Specify NULL to ignore this option. - namebuf
- A buffer to save the pathname in. Specify NULL to ignore this option.
- nblen
- The length of the buffer pointed to by namebuf. Specify 0 to ignore this option.
Library:
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
Description:
The fcfgopen() function is similar to cfgopen() with these exceptions:
- The CFGFILE_NOFD flag isn't valid.
- The values for flags described in open() aren't valid.
Returns:
A valid FILE * pointer, or NULL if an error occurs (errno is set).
Errors:
- EINVAL
- An argument is invalid.
- ENAMETOOLONG
- The path argument exceeds PATH_MAX in length.
- ENOENT
- The specified path doesn't exist, or path is an empty string.
Classification:
| Safety: | |
|---|---|
| Cancellation point | Yes |
| Interrupt handler | No |
| Signal handler | Yes |
| Thread | Yes |
Page updated:
