The fopen
family of functions in C is
normally used for reading configuration files, since fgets
is an easy way to parse files on a line-by-line basis. The
INKfopen
family of functions is intended to solve
the same problem of buffered IO and line at a time IO, in a platform-independent manner. The
fopen
family of C library functions can only open a
file if a file descriptor less than 256 is available. Since Traffic Server
often has more than 2000 file descriptors open at once, however, the
likelihood of an available file descriptor less than 256 very small. The
INKfopen
family can open files with descriptors
greater than 256.
The INKfopen
family of routines is not
intended for high speed IO or flexibility. These routines are intended for
reading and writing configuration information when corresponding usage
of the fopen
family of functions is inappropriate because of file
descriptor and portability limitations. The INKfopen
family of functions consists of the functions below.
Closes a file.
void INKfclose (INKFile
filep
)
is the file
to close.filep
Closes the file pointed to by
and frees the data
structures & buffers associated with it. If the file was
opened for writing, then any pending data is flushed.filep
See the example for INKfopen