Re: Get oldest folder

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tim Golden

    Re: Get oldest folder

    jyoung79@kc.rr. com wrote:
    I'd like to be able to get the path to the oldest folder in whatever directory
    I'm currently in. Is there a simple way to go about this?
    I'd like it to run on both OS X and Windows XP.
    I found this example but was curious if there's a better way to do this?
    Better: I don't know. Alternative, certainly:

    <code>
    import os, glob

    PATH = "c:/python25/lib/site-packages"
    print min ((f for f in glob.glob (os.path.join (PATH, "*")) if os.path.isdir (f)), key=os.path.get ctime)

    </code>


    TJG
Working...