Question: This is continuation of the code. Part 2. C/C++ program 2 Handling File Redirection input, output, output append) 4 Design and implement CC++ program (myfie.c)

 This is continuation of the code. Part 2. C/C++ program 2

This is continuation of the code.

Handling File Redirection input, output, output append) 4 Design and implement CC++

Part 2. C/C++ program 2 Handling File Redirection input, output, output append) 4 Design and implement CC++ program (myfie.c) in loop: (1) to prompt for a command, (2) to read a command 5 from keyboard as you type), (3) to echo the command, (4) to fork a child process to process command while the 6 parent process is waiting for child process to complete this part, and then (5) the parent is back to the command 7 prompt for next command. 9 The commands are: read, write, and append, and exit. The following tasks (that is, test cases) are to be 10 implemented. 11 12 Taskl. When the command is exit", then the program terminates with exito0) 13 14 Task2. The "read" command will do a file-redirection for a file to be read and to be written to a temporary file. For 15 example, read hellac" will read a file "hellac" and write it to a temporary file ("temp.txt") 16 17 Task3. The "write" command will do a file-redirection for a file ("temp.txt") to be read and written to a file. For 18 example, "write outi.c" will read the save temp file "temp.txt" and write it to the file ("outl.c"). 19 20 Task4. The "append" command has a file-redirection for a file (temp.txt) to be appended to a file. For example, 21 "append out2.c" will read the save temp file "temp.txt" and write it to the file (out2.c"). 22 23 Task5. You may have two commands with a pipe. For example, "read

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!