setting directory mod date

MRAB google at
Tue Mar 24 23:10:50 CET 2009

jyoung79 at wrote:
> I've got some Python code (2.5.1) that's compressing folders 
> on a Windows machine.  When the directories get 
> compressed, their modification date changes.  Is it possible 
> to grab the modification date of the folder before it's 
> compressed, and then set it's modification date back to it's 
> original state after it's compressed?  I've been reading 
> different articles on-line about this, but nothing looks very 
> promising.  I haven't tested os.utime() or win32file since 
> others have said these won't work correctly with folders on 
> Windows XP.
I've just tried it. os.utime() _does_ work correctly on folders.

More information about the Python-list mailing list