473,323 Members | 1,550 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,323 software developers and data experts.

How to change a file's date/timestamp?

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

Jul 18 '05 #1
1 7721
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
Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: [ EuGeNe ] | last post by:
Hi all, I would like to write a script that downloads one file from a ftp server if the file creation date satisfy a condition. I can't figure out how to find from a ftp server what is the...
1
by: Dave Lambert | last post by:
Hi, hope someone can help, I would like to change permissions on a folder and wondered if it is possible as part of an automated install, the reason being we have created an install for an asp.net...
3
by: sparks | last post by:
Have to read in a bunch of files into access and wanted to ask is there a way to read the file modification date before reading them in so I don't read files that I have already read? man thats...
4
by: wil | last post by:
Dear All, In the linux platform, is there anyway I can in a C program change the file create date? Thanks, wil.
3
by: terrychangsharp | last post by:
I think this must be easy but, alas, I can't find it! Is there any function I can use to change a file's date/time?
7
by: bdbeames | last post by:
I never used Perl before, so I need a little help formating a date. What I'm doing is querying a postgres database and then creating a .xml file for a RSS feed. I don't know how to correctly format...
1
by: avinashpr | last post by:
Hi, How do i fetch the information pertaining to a file like file creation date, modified date.....in c++. small code snippet is hieghly appreceated cheers, avinash
1
by: Enij | last post by:
Hi All, I'm using VB.net 2003 Standard Edition, and I'm trying to retrieve the file modified date. Sounds painfully simple. Yup. But ... I cannot, for the life of me, figure it out. After...
2
by: gavin9822623 | last post by:
I need to set a file creation date to "2005/01/01 13:00:00 PM". The date format is (YYYY/MM/DD). Any help or example will be greatly appreciated. Thank you Gavin
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.