CSc 3320 System-Level Programming
Fall 1999
Homework #2
Due: 13 October 1999 (Wednesday)


  1. Modify the junk utility of Chapter 6 to add the following functionality:
    • Add a -c option that compresses all files in the .junk directory; Make sure that files that are already compressed are not compressed a second time.
    • Modify the -p option to take an optional parameter n. Files should only be purged (deleted) if they are more than n days old. If n is not specified, it should default to 3 days.
    • Call this file junk


  2. Modify the handin script to include the following functionality:
    • A file, called /usr/people/raj/students, containing the names of students eligible to submit assignments is available to the script. The script should check to see if the name of the user submitting the assignment is in this file. If it is, the submission process should continue. Otherwise, an error should be reported in the error.log file.
    • A file, called /usr/people/raj/handin.conf, containing the submission deadline and submission cutoff deadline for each assignment is available to the script. The format of this file is as follows:
      1 9/9/1999 9/23/1999
      2 10/8/1999 10/28/1999
      3 10/20/1999 11/8/1999
      4 11/8/1999 11/18/1999
      5 11/20/1999 11/28/1999
      
      Each line contains the assignment number, the deadline date and the cutoff date. The script should check to see the time of submission and copy the files to the
      /tmp/3320/N/USER/
      
      directory if the submission time is before or equal to the deadline. The files should be copied to the
      /tmp/3320/N.late/USER/
      
      directory if the submission time is after the deadline and before or equal to the cutoff time. If the submission time is after the cutoff time, the files should not be submitted and an error message should be logged.