Initiates a pipe to a process.
Standard C Library (libc.a)
#include <stdio.h>
FILE *popen ( Command, Type)
const char *Command, *Type;
The popen subroutine creates a pipe between the calling program and a shell command to be executed.
If streams opened by previous calls to the popen subroutine remain open in the parent process, the popen subroutine closes them in the child process.
The popen subroutine returns a pointer to a FILE structure for the stream.
Some problems with an output filter can be prevented by flushing the buffer with the fflush subroutine.
The popen subroutine returns a null pointer if files or processes cannot be created, or if the shell cannot be accessed.
The popen subroutine may set the EINVAL variable if the Type parameter is not valid. The popen subroutine may also set errno global variables as described by the fork or pipe subroutines.
The fclose or fflush (fclose or fflush Subroutine) subroutine, fopen, freopen, or fdopen (fopen, fopen64, freopen, freopen64 or fdopen Subroutine) subroutine, fork or vfork (fork, f_fork, or vfork Subroutine) subroutine, pclose (pclose Subroutine) subroutine, pipe (pipe Subroutine) subroutine, wait, waitpid, or wait3 subroutine.
File Systems and Directories in AIX 5L Version 5.2 General Programming Concepts: Writing and Debugging Programs.