For this assignment you will write a Linux program that creates a three stage pipeline. This assignment makes use of the files contained in this zip file. This assignment is due Monday, November 19.
Write a Linux console program, called hw2.c
, that builds a three stage pipeline using the filter programs filter_1.c
, filter_2.c
, and filter_3.c
from the assignment's zip file. The pipeline should be equivalent to this command-line (which is in the pipeline.sh
shell script in the zip file).
./filter_1 | ./filter_2 | ./filter_3
In the zip file there are files that you can use to test your program. The following two command-lines should each produce output exactly like the contents of the file data_file_filtered.txt
from the zip file.
./hw2 < data_file.txt ./pipeline.sh < data_file.txt
The three filter programs were designed so that if you get their order in the pipeline incorrect, then you will not get the correct output.
Your program should be based on the example programs from the folder
9. Child to Child Pipeline/Posix
in the following zip file.
In addition to writing the code that creates the pipeline, write a separate document that explains the steps that your code goes through in order to create the pipeline. Your explanation should be similar to one of the explanation files contained in the above mentioned folder. If you write a good explanation of the steps, including diagrams of all the processes with all of their file descriptors, then the code you need in hw2.c
will follow directly from your explanation. In other words, write (and draw) your explanation first, and then write your code.
Turn in a zip file called CS590Hw2Surname.zip
(where Surname
is your last name) containing your version of hw2.c
and your explanation of your code in hw2.txt
. (Your explanation does not have to be a text file. Use whatever document format works best for you.)
This assignment is due Monday, November 19.