Fall 2007 CSci 553 Lab 4
Exercise 4.1
create a directory labs/lab04 and add it to your repository.
You will use this directory to add and submit the python programs you write for the following exercises:
Exercise 4.2
os.stat(path) returns an object whose members describe various properties of the file or directory identified by path. Using this, write a function that will determine whether or not a file is more than one year old.
Exercise 4.3
Write a simple version of which in Python. Your program should check each directory on the caller's path (in order) to find an executable program that has the name given to it on the command line.
Exercise 4.4
Use the os.path, stat, and time modules to write a program that finds all files in a directory whose names end with a specific suffix, and which are more than a certain number of days old. For example, if your program is run as oldfiles /tmp .backup 10, it will print a list of all files in the /tmp directory whose names end in .backup that are more than 10 days old.