#include <xtend/fast-file.h>
-lxtend
int ffpclose(ffile_t *stream)
stream ffile_t stream opened by ffpopen(3)
ffpclose(3) closes a stream opened by ffpopen(3), and waits for the child
process to complete and returns its exit status.
The ffile_t system is simpler than and several times as fast as
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.
Exit status of the child process spawned by ffpopen(3), or -1 on error
ffile_t *instream;
if ( (instream = ffpopen("xzcat file.xz", O_RDONLY)) == NULL )
{
fprintf(stderr, "Failed to read xzcat file.xz.n");
exit(EX_NOINPUT);
}
ffpclose(instream);
ffopen(3), ffpclose(3), popen(3), open(3)