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

Alan Bateman Alan.Bateman at oracle.com
Mon Dec 4 12:49:01 UTC 2017


On 04/12/2017 09:22, Ismael Juma wrote:
> Hi all,
>
> The following was stated in JDK-8177809:
>
> "File.getLastModified() always returns with second precision, loosing 
> the milliseconds (i.e. a number ending in 000). I tried using 
> Files.getLastModifiedTime and it seems to work correctly."
>
> It doesn't look like Files.getLastModifiedTime works correctly either 
> (at least in some cases). I tested Java 10 on macOS High Sierra and 
> APFS and File.getLastModified has better behaviour now:
>
Thanks. The changes for JDK-8177809 in JDK 10 need additional changes to 
the NIO implementation. There was a brief discussion on core-libs-dev 
recently about this too.

-Alan


More information about the nio-dev mailing list