Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Python (http://www.velocityreviews.com/forums/f43-python.html)
-   -   How to change a file's date/timestamp? (http://www.velocityreviews.com/forums/t334649-how-to-change-a-files-date-timestamp.html)

pythos 08-20-2004 05:09 AM

How to change a file's date/timestamp?
 
How do you change a file's last-modified date and timestamp in Python?


Peter Hansen 08-20-2004 11:07 AM

Re: How to change a file's date/timestamp?
 
pythos wrote:

> How do you change a file's last-modified date and timestamp in Python?


utime(...)
utime(path, (atime, utime))
utime(path, 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.


This and many other functions are in the 'os' standard module, one
of the few very very widely used and useful modules... you should
read the online docs for it, along with "sys", and "time" at least,
before doing any more coding. ;-)

-Peter


All times are GMT. The time now is 06:02 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.