In-Class Assignment 8
This assignment will get you used to re-using existing code in available modules, rather than re-inventing the wheel for various common tasks.
Write a program that will take two options on the command line: a directory to recursively search, and a given size. The user can specify these options in any order, and will do so by prefixing the directory with '--dir ' and the size with '--size '.
Your program will recursively search the directory specified by the user, looking for files whose size is greater than or equal to the specified size. Print out the full path of every such file.
For a bonus half-point, download the Mail::Send module from CPAN, and allow the user to specify an address on the command line (via a --email option). Send the results of your search to this email address as well as the screen. (Once the module is downloaded and installed, don't forget the appropriate 'use lib' statement in your code)
Requirements
You must use the File::Find and
Getopt::Long modules to complete this assignment.
"Hand-rolled" solutions are not acceptable.
Sample output
If a user runs your program like so:
ica8.pl --size 20 --email paul@example.com --dir ~lallip/public/ic8
your program should output the following, with the results also emailed to paul@example.com
Files in /home/36/lallip/public/ic8/ larger than 20: /home/36/lallip/public/ic8/file2.txt /home/36/lallip/public/ic8/child/big.txt /home/36/lallip/public/ic8/child/more.txt
Submission
To submit your program, execute~lallip/public/ic_submit.pl on rcs-sun4.rpi.edu. Your submission must be
received by 6pm today, Wednesday, November 2.
