[cs631apue] HW#2

Jan Schaumann jschauma at stevens.edu
Fri Sep 30 22:06:34 EDT 2011


Hello,

I've just finished grading HW#2.  Most of you did well, but all of you
had some issues.  I'd like to give you an opportunity to submit another
version of your program after you have reviewed this email and your code
once more.

General advise:
- remember to check the return value of any function that can fail
- remember to have explicit 'else' blocks for your 'if's
- implement error reporting using strerror(3)/perror(3)
- make sure to write error messages to stderr, not stdout
- consider all possible edge-cases of the program invocation:
	- empty files
	- gigantic files
	- file permissions on source or destination
	- copying over existing files
	- copying a file onto itself
- use strncat/strlcat, strncpy/strlcpy etc. instead of the non-n/non-l
  versions

I have a simple test script that I use to verify some basic
functionality at:

 http://www.cs.stevens.edu/~jschauma/631/testcp.sh

You can run it to check if your program passes the basic requirements
(though that is not all that I'm testing) by running:

sh testcp.sh -p path/to/your/executable

(Pass it one or more "-v" flags to have it report what it's doing.)

If you would like to review your code and resubmit it, please do so by
2011-10-03 18:15:00.

-Jan


More information about the cs631apue mailing list