CS611
Programming Assignment 1
Fall 2001


You are to implement two standard UNIX utilities: uuencode and uudecode. Your implementation should be based on the Linux version of these tools. See the man pages available on the CIS Linux machines:

The specification for this assignment are those man pages plus the utilities themselves. Run the Linux versions of the programs to see what they do with different command-line arguments and different inputs. Your goal is to match this behavior.

Grading will be based upon completed, correct functionality:

  1. Basic uuencode functionality (40 points): read from stdin, write to stdout, no -m command-line flag, and you do not need to correctly process the file mode (simply use 700 for the mode when outputing the "begin" line).

  2. Basic uudecode functionality (17 points): read from stdin, write to stdout, you do not need to correctly process the file mode, and no base64 encodings in the input.

  3. Odds and ends (each one is 3 points for a total of 18 points):

  4. The -m (or --base64) command line option with uudecode and base64 encodings in files passed to uudecode (15 points).

  5. Correctly handling the file mode in both uudecode and uuencode (10 points).

The above tasks must be completed in the order that they are listed. For instance, you must implement uuencode first, then uudecode.

The file ~cs611/public/prog1/a.out will be used for grading. All other tests will be hidden.

Your program will be graded primarily by testing it for correct functionality. However, you may lose points if your program is not properly structured or adequately documented.

Before starting, be sure you understand that the input to uuencode is likely to be a binary file (i.e. not an ASCII file) and is therefore likely not viewable using the standard editing tools or by sending it to an ASCII display device.

You may find using the od command helpful for analyzing binary files. In particular, using the -tx1 flag will display the bytes of a file, one byte at a time, in hexadecimal.

When implementing the file mode, the following man pages may be useful:

You must write your programs in C. The source for program uuencode should be placed into a file called "uuencode.c". The source for program uudecode should be placed into a file called "uudecode.c".

You must submit a Makefile (called "Makefile") so that I can conveniently build your programs. The Makefile goal of "uuencode" should build an executable called "uuencode" and the goal of "uudecode" should build an executable called "uudecode".

Your assignment should be submitted for grading from a CIS Alpha machine (e.g. cisunix.unh.edu). To turn in this assignment, type:
~cs611/bin/submit prog1 uuencode.c uudecode.c Makefile

Do not turn in any other files!

Submissions can be checked from a CIS Alpha machine by typing:
~cs611/bin/scheck prog1

To receive full credit for the assignment, you must turn in your files prior to 8am on Monday September 17. Late submissions will be accepted at the penalty of 5 points per day up to one week late.

Your programs will be graded using an Intel IA-32 Linux machine (e.g. kng509.unh.edu) so be sure to test in that environment.

Remember: as always you are expected to do your own work on this assignment. Copying code from another student or from sites on the internet is explicitly forbidden!

If you developed your code on a DOS/Windows system, be sure to appropriately transfer your files to the CIS Alpha systems before submitting them. You need to convert the DOS ASCII file format to UNIX format. If you need help with this, please see me.


Last modified on August 28, 2001.

Comments and questions should be directed to pjh@cs.unh.edu