Index: Lib/javaos.py =================================================================== --- Lib/javaos.py (revision 3363) +++ Lib/javaos.py (working copy) @@ -30,7 +30,9 @@ import java.lang.System import javapath as path from UserDict import UserDict +import time + class stat_result: import stat as _stat @@ -147,10 +149,20 @@ return stat_result((0, 0, 0, 0, 0, 0, size, mtime, mtime, 0)) def utime(path, times): - # Only the modification time is changed (and only on java2). - if times and hasattr(File, "setLastModified"): - File(path).setLastModified(long(times[1] * 1000.0)) + """utime(path, (atime, mtime)) + utime(path, None) + + Set the access and modified time of the file to the given values. If the + second form is used, set the access and modified times to the current time. + Note that on Jython only moditified time is set. + """ + if times is not None: + mtime = times[1] + else: + mtime = time.time() + File(path).setLastModified(long(mtime * 1000.0)) + class LazyDict( UserDict ): """A lazy-populating User Dictionary. Lazy initialization is not thread-safe.