quick equivalent of 'touch' command?

Mats Wichmann mats at laplaza.org
Sat Oct 28 20:17:06 EDT 2000


Anybody got a quick pointer for me?

I've got a whole mess of mailbox files to convert on a Win* system.
The email client is Eudora which for each .mbx file keeps a .toc
Table-of-Contents file.  It thinks the .toc is corrupt if the mod date
it later on the .mbx than on the .toc.  What I'd like to do is change
only the necessary files, then do the UNIX-equivalent of the "touch"
command on the matching .toc file. The change I make does not
invalidate the .toc file, so this is okay to do. Is there an efficient
way in Python to update the mod time without really changing the
file's data?

This conversion is a recurring operation (sigh - don't ask) so it's
worth getting it right.  I've been using a shell script under the
Interix environment - which includes touch and other UNIX tools - but
I'm not going to have that available in all situations in the future.

Mats Wichmann

(Anti-spam stuff: to reply remove the "xyz" from the
address xyzmats at laplaza.org. Not that it helps much...)



More information about the Python-list mailing list