Update of /cvsroot/jython/jython/Lib
In directory usw-pr-cvs1:/tmp/cvs-serv6878
Modified Files:
javaos.py
Log Message:
Fix for "[ #477793 ] os.utime() is missing".
Added a utime() function that can change the modification time on a file.
It does not change the access time and it only works on java2.
Index: javaos.py
===================================================================
RCS file: /cvsroot/jython/jython/Lib/javaos.py,v
retrieving revision 2.7
retrieving revision 2.8
diff -C2 -d -r2.7 -r2.8
*** javaos.py 2001/07/16 17:04:56 2.7
--- javaos.py 2001/11/03 15:51:36 2.8
***************
*** 90,91 ****
--- 90,97 ----
mtime = f.lastModified() / 1000.0
return (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))
+
|