To implement and test a C program using system calls for files and directories.
Description
Find is a popular UNIX command that traverses a file hierarchy and performs various functions on each file in the hierarchy. The goal of this project is to implement a program similar to find that supports the following functionality:
1. The program should take the directory name from where to start the file traversal as a command-line argument and print the file hierarchy starting with the directory that is provided by the command-line argument.
2. If the program is executed without any arguments, the program should print the file hierarchy starting with the current directory where the program is executed. If there are no directories in the current directory only files are listed one per line.
3. If there are other directories in the current directory then the directory name is first displayed on a separate line and then the files in that directory are listed one-per-line with one-tab indentation.
4. If a file is a symbolic link then the program should display the symbolic link name and in parentheses the file name the link points to.
5. The program should also support two command-line options:
1. -s <file size in bytes>
This should list all files in the file hierarchy with file size greater than or equal to the value specified.
2. -f <string pattern>
This should list all files in the file hierarchy whose file name or directory name contains the substring specified in the string pattern option.
6. If both -s and -f options are specified then the program should list only those files that match both criteria. The order of the options should not matter.
Guidelines and Hints
1. The program must use function pointers similar to Figure 4.22 in the text book to implement the functionality described above. You can use the logic and structure from Figure 4.22 as the starting point to implement this program (make sure to go over the program in Figure 4.22 and understand all the steps performed). However, please note that your final program must compile and execute without any dependencies on the source code provided by the text book.
2. You should use a Makefile to compile and build this project and make sure to submit the Makefile along with the rest of the source code.
3. You should create a tar file with all the source code, Makefile, and a README file and upload the tar file to Canvas. Please do not include any object files or executable files in the tar file.
Program Documentation and Testing
1. Use appropriate names for variables and functions.
2. Include meaningful comments to indicate various operations performed by the program.
3. Programs must include the following header information within comments:
4. Test your program with the sample test cases provided as well as your own test cases.
5. You can include any comments you may have about testing in the README file.
DescriptionIn this final assignment, the students will demonstrate their ability to apply two ma
Path finding involves finding a path from A to B. Typically we want the path to have certain properties,such as being the shortest or to avoid going t
Develop a program to emulate a purchase transaction at a retail store. Thisprogram will have two classes, a LineItem class and a Transaction class. Th
1 Project 1 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of
1 Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of