_xt_ff_pclose(3)

NAME
_xt_ff_pclose() - Close a stream created by xt_ff_popen(3)

LIBRARY
#include <xtend/fast-file.h>
-lxtend

SYNOPSIS
int     _xt_ff_pclose(xt_ff_t *stream)

ARGUMENTS
stream  xt_ff_t stream opened by xt_ff_popen(3)

DESCRIPTION
_xt_ff_pclose(3) closes a stream opened by xt_ff_popen(3), and waits for the child process to complete and returns its exit status. The xt_ff_t system is simpler than and much faster than traditional FILE on typical systems. It is intended for processing large files character-by-character, where low-level block I/O is not convenient, but FILE I/O causes a bottleneck.

RETURN VALUES
Exit status of the child process spawned by xt_ff_popen(3), or -1 on error

EXAMPLES
xt_ff_t *instream;
if ( (instream = xt_ff_popen("xzcat file.xz", O_RDONLY)) == NULL )
{
    fprintf(stderr, "Failed to read xzcat file.xz.n");
    exit(EX_NOINPUT);
}
_xt_ff_pclose(instream);

SEE ALSO
xt_ff_open(3), _xt_ff_pclose(3), popen(3), open(3)