Summary: | touch task truncates timestamps | ||
---|---|---|---|
Product: | Ant | Reporter: | Alexander Pogrebnyak <alex-pub.apache-ant> |
Component: | Core tasks | Assignee: | Ant Notifications List <notifications> |
Status: | REOPENED --- | ||
Severity: | normal | ||
Priority: | P2 | ||
Version: | 1.7.1 | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | Windows XP |
Description
Alexander Pogrebnyak
2009-10-15 16:34:16 UTC
Ant uses the lastModified and setLastModified methods in java.io.File http://java.sun.com/j2se/1.4.2/docs/api/java/io/File.html which doesn't allow a granularity smaller than millisecond. I don't understand why outofdate seems to be rounding up here but as far as I can see there isn't anything touch could do differently as it set the last modified time to the one read from the source file. CANTFIX rather than WONTFIX. (In reply to comment #1) > Ant uses the lastModified and setLastModified methods in java.io.File > http://java.sun.com/j2se/1.4.2/docs/api/java/io/File.html which doesn't allow a > granularity smaller than millisecond. > > I don't understand why outofdate seems to be rounding up here but as far as I > can see there isn't anything touch could do differently as it set the last > modified time to the one read from the source file. > > CANTFIX rather than WONTFIX. How about setting it to newFile.setLastModified( origFile.lastModified() + 1 ) This will definitely round it in the right direction. Plus it would probably integrate better with the tools external to ant (e.g. make), that could have used the newly created file. |