Design a file-copying program in the c programming language


Problem -

Design a file-copying program, in the C programming language, named filecopy using ordinary pipes. This program will be passed two parameters: the name of the file to be copied and the name of the copied file. The program will then create an ordinary pipe and write the contents of the file to be copied to the pipe. The child process will read this file from the pipe and write it to the destination file. For example, if we invoke the program as follows: filecopy input.txt copy.txt

the fileinput.txtwill be written to the pipe. The child process will read the contents of this file and write it to the destination file copy.txt.

Write this program using UNIX pipes.

Apply appropriate error handling, see the General Notes Section below.

General Notes: Error handling - Handle errors using appropriate error handling techniques.

  • A bad or missing command line argument should cause the program to exit after it prints usage instructions in the same way many Linux command line utilities do. Ex: "usage: myprog arg1 arg2"
  • Regular errors should be printed to stderr by means of fprintf(). The choice of when to terminate the program on specific errors is left to you.
  • Failed system calls should use the perror() function for reporting error messages.

Attachment:- Assignment File.rar

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: Design a file-copying program in the c programming language
Reference No:- TGS02464265

Expected delivery within 24 Hours