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.
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.
Step by step
Solved in 3 steps with 2 images