Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C + + Will introduce inter process communication and redirection. We will use pipe ( ) and dup ( ) / dup 2 ( )
C Will introduce inter process communication and redirection. We will use pipe and dupdup
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
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.
If no arguments are given, standard output to the terminal
Use one of the optional arguments o or b for an extra on your A
Execute the command without any errors
Pipe the output from the child to the parent process
Successfully redirect the parent process output to the correct location
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.about the output.txt would problaby need to be created. The output should be this:
Fork created successfully
Hello world
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started