untested, ugly, but something like this would sort all the files in the
directory on os.path.getctime (not using os.walk() though). I'm sure
there is probably better ways to do it
filelist = []
def walkdir(currdir):
for files in os.listdir(currdir):
path = os.path.join(currdir, files)
if not os.path.isdir(path):
filelist.append([os.path.getctime(path), path])
else:
walkdir(path)
walkdir(r'c:\somedirectory')
filelist.sort()
for item in filelist:
dosomething(item[1])
dosomething is whatever function to process the files