In: Computer Science
Write a program that copies the contents of one file to a destination file. This program works by first prompting the user for the name of the source and destination files. Be sure to include all necessary error checking, including ensuring that the source file exists. Also, if available, you have to use Linux system calls and not standard C library functions in your program.
[Restrictions] For file handling operations, only use the open, close, read and write system calls. For other operations you can use the library functions. For every use of library function where system call was required, 2 marks will be deducted.
Following error situations must be taken care of in the code: File not present, read error, write error, close error, create error, return value of system calls.
Using the above following code logic Or example, you can write the code for complete file handling. I have just provided logic for all the above description. Thank you.