FILE *popen(const char *command, const char *type);
The type argument is a pointer to a null-terminated string which must be `r' for reading, `w' for writing, or `r+' for reading and writing.
The return value from popen() is a normal standard I/O stream in all respects save that it must be closed with pclose() rather than fclose().