Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Will introduce inter process communication and redirection. We will use pipe() and dup(). The assignment is to pipe output from the child to the parent.

image text in transcribed

image text in transcribed

Will introduce inter process communication and redirection. We will use pipe() and dup(). The assignment is to pipe output from the child to the parent. Your program should: Check to verify the fork was created Prompt for a command and arguments There are two arguments that are optional -o and -b O -o standard output is redirected to the file output.txt only. O -b standard output is redirected to the file output.txt and the monitor o No arguments standard output to the monitor Execute the command from a child process Pipe the output from the child to the parent process Redirect the parent process standard output to output.txt If output.txt does not exist, then your application should create it. If it does exist, then the file should be truncated and over written. #include #include using namespace std; Sint main() { pid_t pid = fork(); if (pid 0) { cout #include using namespace std; Sint main() { pid_t pid = fork(); if (pid 0) { cout

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Moving Objects Databases

Authors: Ralf Hartmut Güting, Markus Schneider

1st Edition

0120887991, 978-0120887996

More Books

Students also viewed these Databases questions

Question

Question What is the advantage of a voluntary DBO plan?

Answered: 1 week ago