Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: JRuby 1.5
-
Fix Version/s: JRuby 1.5.1, JRuby 1.6RC1
-
Component/s: Standard Library, Windows
-
Labels:None
-
Environment:Windows XP
-
Testcase included:yes
-
Number of attachments :
Description
The attached spec compares the mtime of a directory before and after invoking FileUtils.touch on that directory. The spec fails since the mtime is not modified. Invoking touch on the same directory via cygwin does correctly update the mtime.
Some further investigation showed that the problem is in the jnr-posix library. It attempts to use the _utime64 function from msvcrt. The documentation of this function clearly states this does not work on directories. I've modified the windows posix implementation to use SetFileTime instead of _utime64 (see attached patch). This works on both files and directories.