Question: Write a C program that mimics the c p command using open ( ) system call to open source.txt file in read - only mode

Write a C program that mimics the cp command using open() system call to open source.txt file in read-only mode and copy the contents of it to destination.txt using read() and write() system calls. While reading and writing follow the below procedure:
a. Read the next 100 characters from source.txt, and among characters read, replace each character '1' with character 'A' and all characters are then written in destination.txt
b. Write characters "XYZ" into file destination.txt
c. Repeat the previous steps until the end of file source.txt. The last read step may not have 100 characters.
Program execution: ./yourProgram source.txt destination.txt
Please only use system call functions for file manipulation and create a folder for this problem
 Write a C program that mimics the cp command using open()

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!