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 single command, but you can easily sort the results of
listdir using any criteria. Most file attributes can can be obtained
using os.stat (size, creation date, modification date, etc), and you can
just use that as a key to sort().
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to