CS 3733 Operating Systems, Spring 2000 Assignment 3 Comments


This assignment was graded on a basis of 30 points.

  1. In get_file_data you must allocate space for the full path name. Do not forget the two extra bytes for the / and the string terminator.
  2. Most people did not clean up in get_file_list when an error occurred.
  3. You are not allowed to assume a maximum number of files.
  4. There is no need to read one character at a time.
  5. Cannot use strcpy to copy data read in from the file. The file may be a binary file.
  6. Do not exit the program from a library function.
  7. get_directory_files should not return a statically allocated buffer
  8. get_directory_files must free the filelist
  9. You do not need to malloc for the return value of opendir.
  10. Data files are not strings. Cannot use %s to print them.
  11. There is a difference between sizeof and strlen.
  12. In get_file_list you must allocate space for the name and copy them in rather than using the value from the direntp. From the man page for readdir:
         The pointer returned by readdir() points to data  which  may
         be  overwritten  by  another  call  to readdir() on the same
         directory stream.