File in a directory

Fredrik Lundh fredrik at
Fri Mar 23 17:18:40 CET 2001

Oliver Marugg wrote:
> Has anyone an idea how to solve that with the size or timestamp
> verification?

  os.listdir(dir) => list of files in directory dir
  os.path.getsize(file) => size of file
  os.path.getmtime(file) => time of last modification (in seconds since epoch)
  time.time() => current time (in seconds since epoch)
+ five to ten minutes of your time
= solution

reference info here:

Cheers /F

More information about the Python-list mailing list