fork download
  1. import pathlib
  2. import stat
  3.  
  4.  
  5. paths = pathlib.Path(".").glob("*")
  6. files = filter(lambda p: stat.S_ISREG(p.stat().st_mode), paths)
  7. path = min(files, key=lambda p: p.stat().st_ctime)
  8. print(path, path.stat())
Success #stdin #stdout 0.04s 10680KB
stdin
Standard input is empty
stdout
prog os.stat_result(st_mode=33188, st_ino=17886255, st_dev=2307, st_nlink=1, st_uid=0, st_gid=110, st_size=509, st_atime=1466630530, st_mtime=1466630530, st_ctime=1466630530)