The purpose of this homework is to give the student experience writing a low-level tool in C, using multiple POSIX systems calls, and handling all possible failure conditions.

Writing a copy Program in C

For this assignment, you must write a program in C to copy the contents of one file to another file. Details follow:

Honors students

Your code should optionally take a -r flag before the src and dest arguments. When -r is given if src is a directory, then your code creates the directory dest, and copies every file in src into the new directory dest. Your code does not have to recurse down any further in the src directory. If there are sub-directories in src, your code should create those sub-directories in dest but it does not have to populate them.

Checking In

Submit all the code for this homework to /home/cs/232/current/<yourid>/homework02/.

We will grade this exercise according to the following criteria: (25 pts total)