File in a directory

Oliver Marugg oliver at centralnet.ch
Sat Mar 24 10:01:08 EST 2001


Fredrik,

Thank you that was the glue I needed... now it works.

Oliver

Fredrik Lundh wrote:

> 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:
> http://www.python.org/doc/current/lib/module-os.html
> http://www.python.org/doc/current/lib/module-os.path.html
> http://www.python.org/doc/current/lib/module-time.html
>
> Cheers /F




More information about the Python-list mailing list