Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Both of the following programs relate to theinter-process communication using tw

ID: 3611132 • Letter: B

Question

Both of the following programs relate to theinter-process communication using two different techniques: fileand pipe.

Q1:Write a C/C++ programthat creates a child process. The child process stores names of allthose files that have a size greater than n bytes (n is user inputto the child process) in a temporary file (this list should notinclude names of directories). The parent process thenreads this file and prints the statistics (number of words, linesand characters) for each file. The temporary file is then deletedby the parent process.

Make sure that the parent process prints theinformation after the child process has stored the requiredinformation in the temporary file.

Q2:Solve Q1 using a pipe;that is the child process will send the file names to the parentprocess using a pipe. Then the parent will print the statistics(words, lines and characters) for each file separately as itreceives file name from the pipe. The value of n should be passedto the child process by the parent process. Note that this requiresfrom you to use two pipes, one to send the value of n from parentto child and second to receive the file names.

Explanation / Answer

Both of the following programs relate to theinter-process communication using tw

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote