Write a program in C/C++ which is passed as command line argument a file name. Your program will read data from the file using read system call. The program will then pass the contents of the file to a pipe and create a child process. The child process will read the file’s content from the pipe. The child process does two things to the file data: 1) it removes all integers from the pipe. 2) It changes the case of all alphabets. The child process then writes the modified file data to the second pipe. The parent then reads this data from the second pipe and writes the data (using write system call) to a new file whose name is also passed as command line argument. The input file from which the data will be read has no size restriction.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter8: I/o Streams And Data Files
Section8.4: File Streams As Function Arguments
Problem 1E
icon
Related questions
Question

Write a program in C/C++ which is passed as command line argument a file name. Your program will
read data from the file using read system call. The program will then pass the contents of the file to a
pipe and create a child process. The child process will read the file’s content from the pipe. The child
process does two things to the file data: 1) it removes all integers from the pipe. 2) It changes the case
of all alphabets. The child process then writes the modified file data to the second pipe. The parent then
reads this data from the second pipe and writes the data (using write system call) to a new file whose
name is also passed as command line argument. The input file from which the data will be read has no
size restriction.

Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
File Input and Output Operations
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr