![]() |
![]()
| ![]() |
![]()
NAME_xt_ff_pclose() - Close a stream created by xt_ff_popen(3) LIBRARY#include <xtend/fast-file.h> -lxtend SYNOPSISint _xt_ff_pclose(xt_ff_t *stream) ARGUMENTSstream 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. Unlike the FILE stream functions popen(3) and pclose(3), it is not necessary to match xt_ff_popen(3) and _xt_ff_pclose(3). The xt_ff_close(3) function automatically senses whether stream if a pipe (FIFO), and calls _xt_ff_pclose(3) or _xt_ff_raw_close(3) as needed. 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 VALUESExit status of the child process spawned by xt_ff_popen(3), or -1 on error EXAMPLESxt_ff_t *instream; if ( (instream = xt_ff_popen("xzcat file.xz", O_RDONLY)) == NULL ) { SEE ALSOxt_ff_open(3), _xt_ff_pclose(3), popen(3), open(3)
|