Question: Assignment # 3 Process Communication Will introduce inter process communication and redirection. We will use pipe ( ) and dup ( ) / dup 2

Assignment #3 Process Communication
Will introduce inter process communication and redirection. We will use pipe() and dup()/dup2().
More information about dup() and dup2()
More information about pipe()
The assignment is to pipe output from the child to the parent. You can choose whichever output you like, but the standard "Hello World" would be sufficient. Your program should:
, Check to verify the fork was created (15%)
Prompt for arguments from the user. There are two arguments that you will need to create (-o and -b); however, they are optional. To prove that the fork works, your program should print "Hello World", in either the standard terminal, the output.txt file, or both. (15% for the prompt)
For -o, output is redirected to the file output.txt only.
For -b, output is redirected to the file output.txt and the terminal
If no arguments are given, standard output to the terminal
Use one of the optional arguments (-o or -b) for an extra 20% on your A3!
Execute the command without any errors (20%)
, Pipe the output from the child to the parent process (20%)
Successfully redirect the parent process output to the correct location (30%)
If you send output to the output.txt, file:
If output.txt does not exist, then your application should create it.
If output.txt does exist, then the file should be truncated and over written.
 Assignment #3 Process Communication Will introduce inter process communication and redirection.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!