Re: Process files in order

2006-07-27 Thread bearophileHUGS
A possibility: import os _, _, file_names = os.walk("").next() print sorted(file_names, key=lambda fn: os.stat(fn)[8]) Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: Process files in order

2006-07-27 Thread Bruno Desthuilliers
Khoa Nguyen a écrit : > Hi, > > I have a requirement to process all files in a directory in > chronological order. Access time, modification time ? Ascending, descending ?-) > The os.listdir() function, however, lists the > files in random order. Is there a similar function in Python that > allo

Re: Process files in order

2006-07-27 Thread Mike Kent
How about using os.listdir to build a list of filenames, then sorting them by modification time (via os.stat)? -- http://mail.python.org/mailman/listinfo/python-list

Re: Process files in order

2006-07-27 Thread Yu-Xi Lim
Khoa Nguyen wrote: > I have a requirement to process all files in a directory in > chronological order. The os.listdir() function, however, lists the > files in random order. Is there a similar function in Python that > allows me to specify the listing order (like ls -t for example)? There is no s

Process files in order

2006-07-27 Thread Khoa Nguyen
Hi, I have a requirement to process all files in a directory in chronological order. The os.listdir() function, however, lists the files in random order. Is there a similar function in Python that allows me to specify the listing order (like ls -t for example)? Thanks, Khoa -- http://mail.python