quick equivalent of 'touch' command?

Olivier Dagenais olivierS.dagenaisP at canadaA.comM
Sun Oct 29 21:46:59 EST 2000


Ah, I was afraid I was missing something, thanks!

--
----------------------------------------------------------------------
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!"


"Clarence Gardner" <clarence at netlojix.com> wrote in message
news:972870769.1201163071 at news.silcom.com...
> On Sat, 28 Oct 2000, Olivier Dagenais wrote:
> >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..
>
> I believe the original poster was working on Windows(TM), so this
> isn't strictly relevant, but for general knowledge I'll mention that on
> unix, the open() mentioned above will not work, and changing the time
> requires superuser privilege.  To touch the file using file methods,
you'll
> have to actually write to it.  E.g., read the first byte from the file and
then
> write it back (which won't work with a zero-length file), or seek to the
end,
> write a byte, then back up one byte and truncate at the file position.





More information about the Python-list mailing list