Creating Pipes From C Language The system call pipe() creates a plumbing pipe pipe(2) creates two descriptors, one WO and one RO There fd's are not connected to the filesystem, they only live in the process Thus, a pipe can only connect processes originating from the same grandparent The C library also offsers popen(3)/pclose(3) They use the same argument conventions as fopen(3)/fclose(3) But you can't just fclose a file returned by popen Popen invokes a shell process, so a whole command line is fine The shell can be written-to or read-from The code is much simpler than running pipe/fork/exec/wait But there's less control over the details