This program demonstrates the equivalent of a popen() command. The parent process creates a named pipe. The parent process then forks a child process. The child process executes ffprobe then sends the output from ffprobe to the parent process through the named pipe.
The full source code for example_fork_exec_pipe.c is available at http://www.cs.sjsu.edu/~bruce/programs/fall_2016_cs_160/example_fork_exec_pipe/example_fork_exec_pipe.c (right mouse click then select "Save link as" to download).
A test video used by above program is available at http://www.cs.sjsu.edu/~bruce/programs/fall_2016_cs_160/example_fork_exec_pipe/video.avi (right mouse click then select "Save link as" to download).
A makefile to compile example_fork_exec_pipe.c is available at http://www.cs.sjsu.edu/~bruce/programs/fall_2016_cs_160/example_fork_exec_pipe/Makefile (right mouse click then select "Save link as" to download).
To compile example_fork_exec_pipe.c, type make within a shell command prompt in the same directory containining example_fork_exec_pipe.c and your Makefile.
Fall 2016, CS-160:
Lectures:
Assignments:
Handouts:
Programs: