Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
_xt_ff_pclose(3)	    Library Functions Manual		_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.  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 automati-
     cally 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 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_close(instream);

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

								_xt_ff_pclose(3)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=_xt_ff_pclose&sektion=3&manpath=FreeBSD+Ports+15.1.quarterly>

home | help