#!/usr/bin/python # -*- coding: utf-8 -*- # Created by Stuart Colville on 2008-02-13 # Muffin Research Labs. http://muffinresearch.co.uk # lastmod: Print lastmodified since n hours import sys,os,time def callback(arg, directory, files): for file in files: path = os.path.join(directory, file) lastmod = int(os.path.getmtime(path)) if lastmod > int(time.time())-(arg*3600): print path.ljust(80), time.strftime("%d-%m-%Y %H:%M:%S",time.gmtime(lastmod)) os.path.walk(".", callback, len(sys.argv) > 1 and int(sys.argv[1]) or 24)