In article <[EMAIL PROTECTED]>,
pekka niiranen  <[EMAIL PROTECTED]> wrote:
>Roy Smith wrote:
>> pekka niiranen  <[EMAIL PROTECTED]> wrote:
>> 
>>>Does anybody know Python recipe for changing the date
>>>of the directory or files in W2K to current date and time?
>>>In UNIX shell command "touch" does it.
>> 
>> 
>> You want os.utime()
>
>Nope, it does not work for directories in Windows

Well, there's always the old fashioned way (which early versions of
touch used).  Read the first byte of the file, rewind, write the byte
back out, seek to the end (to preserve the file length), and close the
file.  I'm not sure what to do for directories (I guess you could
create and delete a temp file).

Of course, if you told me that doesn't work on Windows either, I
wouldn't be too surprised. :-)
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to