JDK-8177809: File.lastModified() is losing milliseconds (always ends in 000)

Alan Bateman Alan.Bateman at oracle.com
Mon Dec 4 15:47:21 UTC 2017


On 04/12/2017 15:41, Ismael Juma wrote:
> Thanks Alan. I had a look at the core-libs-dev discussion and it seems 
> like there was a bit of confusion on whether Files.getLastModifiedTime 
> had the right behaviour or not (Ricardo Almeida briefly mentioned that 
> it did not work for him in Ubuntu as you said). It might be worth 
> adding a comment to the JIRA ticket for others who come across it.
The behavior on Linux should be correct for both methods on JDK 10, 
except if you build OpenJDK with a very old gcc. The discussion on 
core-libs-dev was 8uX where different versions of gcc are used.

Once this code is updated in JDK 10 then the behavior should be 
consistent. It will also sort out the issue on OS X (which did not 
support the higher precision timestamps when originally implemented).

-Alan


More information about the nio-dev mailing list