PROGRAM 8: FindIt.c ------------------- Assigned: Friday April 04, 2003 Deadline: Monday April 14, 2003 at MIDNIGHT The goal of this project is to introduce you to the concepts of directories as they are implemented in UNIX. In this project you will implement a program that recursively searches directories for files or directories that match a substring given to your program as a parameter. Your program mirrors some of the functionality of the UNIX find() command. See the man pages for more details on "find": man find The program must run on ajax, and compile on ajax with the compiler located at /opt/sfw/bin/gcc. KEY CONCEPTS: ------------ - UNIX director structure - directory system calls INPUT/COMMAND LINE: ------------------ Your program should take one command line parameter, that specifies the the pattern of substring that should match the files and directories that you are looking for. Example Command Line: {ajax} FindIt .txt {ajax} The above command line should find all the files and directories containing the string ".txt" in the current directory OR in any of the subdirectories that descends from the current directory. REQUIREMENTS: ------------ o Each time a match is found, print the absolute path name for the matching file or directory. o Test access permission before trying to change to a directory. o Do not follow symbolic links. o This program must be written in C. Your program will be graded using the compiler on AJAX with path: /opt/sfw/bin/gcc. o The programs should be robust and include appropriate error checks. OTHER REQUIREMENTS: ------------------ o Propererly commented code o Modularized program o Good software engineering techniques, hints in text book. o You must submit at least the following files (i.e., all the files necessary to compile your program): README.txt FindIt.c Makefile REPORT.txt - write out sample commands that you ran with its sample output. To submit the files, you will need to use the submit program. Your files need to be under a common subdirectory called "1730_program8". Execute the below command line while in your home directory: submit 1730_program8 cs1730 NOTE: you need to be LOGGED ONTO ajax when you execute the submit command. RESOURCES: --------- Chapter 4 in book, stat() function. command line argument tutorials: http://cplus.about.com/library/weekly/aa042902a.htm http://pardus-larus.student.utwente.nl/DOC/Lang/C/ctut/ctutorial/ argc-and-argv.html printf tutorial: http://cplus.about.com/library/weekly/aa032302a.htm How to use the GCC compiler tutorial: http://pardus-larus.student.utwente.nl/DOC/Lang/C/ctut/ctutorial/ The-compiler.html#The%20compiler GDB (GNU Debugger) tutorial http://cs.ecs.baylor.edu/~donahoo/tools/gdb/ All URL'S listed below have no white spaces.