How to set the Timestamp of a File

Emile van Sebille emile at fenx.com
Fri Mar 22 07:04:48 EST 2002


Jörg Schütter
> How can I set the timestamp of a file (especially under windows) with
> python? In Unix/Linux there is a tool caled touch.
> There is no problem to read the timestamp, but how can I set the
> timestamp to a desired time?

>>> print os.utime.__doc__
utime(path, (atime, utime)) -> None
utime(path, None) -> None
Set the access and modified time of the file to the given values.  If
the
second form is used, set the access and modified times to the current
time.


HTH,

--

Emile van Sebille
emile at fenx.com

---------




More information about the Python-list mailing list