This script is generally quite similar to
bigfiles.py. The only
important difference is how the files are sorted: in this
case, they are sorted in descending order by modification
time, that is, in reverse chronological order.
As with the
bigfiles.py script, we create a class that inherits
PathInfo, and define a different
.__cmp__() method to change the sorting
bigfiles.py, we also redefine the
.__str__() method to change the format used
to display each file's information.
We'll call the derived class
So, here's the overall flow for processing each directory tree named on the command line.
Instantiate a class called
OldReport that holds all the information
needed to generate our report. The class constructor
takes the name of the director as an argument. It
walks the directory tree, makes each thing it finds
OldInfo object, and
then sorts them.
.genFiles() method of
BigReport object to
in reverse chronological order, printing each one as it