Assignment
MUST use version control software (ex: git, mercurial, subversion, etc) to manage your code. You may use a public repository like GitLabs, GitHub, BitBucket, etc to host your code.
Design a file-copying program, in the C programming language, namedfilecopyusing 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.
? MUST use version control software (ex: git, mercurial, subversion, etc) to manage your code. You may use a public repository like GitLabs, GitHub, BitBucket, etc to host your code.
Deliverables
1. The programs should be commented where necessary.
2. Submit only source code and other necessary documentation.
3. Please name your files appropriately to make it clear which question you are answering.