Next: pipe() - Low level Piping Up: Piping in a C program Previous: Piping in a C program

popen() - Formatted Piping

FILE *popen(char *command, char *type) - opens a pipe for I/O where the command is the process that will be connected to the calling process thus creating the pipe. The type is either ``r'' - for reading, or ``w'' for writing.

popen() returns is a stream pointer or NULL for any errors.

A pipe opened by popen() should always be closed by pclose(FILE *stream).

We use fprintf() and fscanf() to communicate with the pipe's stream.
Fri May 20 13:40:49 BST 1994