Be sure you have read chapter 6.
Do the following problems. You may write out your answers by hand or using a word processor or other program, but please submit hard copy, either in class or in my mailbox in the department office.
For extra credit, do the following programming problem. Turn in your code (all files needed) by sending mail to cs4320@cs.trinity.edu, with each of your code files as an attachment. Please use a subject line such as ``homework 6'' or ``hw6''. You can develop your program on any system that provides the needed functionality, but I will test it on one of the department's RedHat 9 Linux machines, so you should probably make sure it works in that environment before turning it in.
[bmassing@Janus01]$ ./filesizes /var/www 512 20
Unable to open /var/www/HTML-Documents/About/The_Courses/cs3291.java/dcernose/javapres/turnin/COM: Permission denied
Unable to open /var/www/HTML-Documents/About/The_Courses/cs3394.hci/dcernose/javapres/turnin/COM: Permission denied
Unable to open /var/www/HTML-Documents/apache-documentation/manual/search: Permission denied
Results for directory /var/www:
2046 files of size 1 blocks
461 files of size 2 blocks
963 files of size 3 blocks
1191 files of size 4 blocks
7201 files of size 5 blocks
9807 files of size 6 blocks
5803 files of size 7 blocks
3604 files of size 8 blocks
1763 files of size 9 blocks
994 files of size 10 blocks
1597 files of size 11 blocks
697 files of size 12 blocks
423 files of size 13 blocks
633 files of size 14 blocks
493 files of size 15 blocks
514 files of size 16 blocks
431 files of size 17 blocks
298 files of size 18 blocks
297 files of size 19 blocks
261 files of size 20 blocks
6136 files of size 21 blocks or more
(Of course, you won't be able to examine files in directories you
don't have access to. That's okay; just print error messages as above.)
Hints: Read the man pages for opendir, readdir, and lstat. You might also be interested in the man pages for chdir and strerror.