quick equivalent of 'touch' command?

Olivier Dagenais olivierS.dagenaisP at canadaA.comM
Sun Oct 29 00:46:37 EDT 2000


Open the file for output/update and close it right after.  You may need to
use the low-level os.open with a few flags.

Or maybe you can just set the file's time/date?  I'd look in the os module
for stuff like this..

--
----------------------------------------------------------------------
Olivier A. Dagenais - Software Architect and Developer
"Someone called 'Type your name here' is impersonating me on the
internet and is posting exactly the same things I am posting!"


"Mats Wichmann" <mats at laplaza.org> wrote in message
news:39fb6922.26843819 at news.laplaza.org...
>
> 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