in reply to File stat problem
Instead of the stat and time functions, you can just use the -M function that tells you the age of a file in days, as a floating point number. That's a bit more convenient.