Update to nanosecond resolution on FileTimes?
Alexander T
mittspamkonto at gmail.com
Fri Jun 2 12:50:59 UTC 2017
Hi Alan,
Great! No problem. It got internal review number 9049380.
Best regards,
Alexander Torstling
On Fri, Jun 2, 2017 at 11:57 AM, Alan Bateman <Alan.Bateman at oracle.com>
wrote:
> On 01/06/2017 20:43, Alexander T wrote:
>
>> Hello Everyone!
>>
>> My name is Alexander Torstling and I'm a software engineer from
>> Stockholm. This is my first mail so I hope that this is the right forum for
>> this subject. Please let me know if this is not the case.
>>
>> So, to the matter at hand: While trying to get maximum resolution out of
>> file modification times on JDK8, I stumbled upon a comment in
>> sun/nio/fs/UnixFileAttributes#toFileTime(long,long)
>> ( http://grepcode.com/file/repository.grepcode.com/java/root/
>> jdk/openjdk/8-b132/sun/nio/fs/UnixFileAttributes.java#
>> UnixFileAttributes.toFileTime%28long%2Clong%29 ):
>>
>> // truncate to microseconds to avoid overflow with timestamps
>> // way out into the future. We can re-visit this if FileTime
>> // is updated to define a from(secs,nsecs) method.
>>
>> It seems like it's possible to re-visit this decision now, since FileTime
>> provides a "from(Instant)" method since
>> 1.8, which would make it possible to up the resolution to nanoseconds.
>>
>> The from(Instant) and toInstant() were added for interoperability, they
> aren't actually need for FileTime to support creating FileTime objects with
> nano second granularity. I can't think of any reason not to look at this
> again, can you create a bug to track it?
>
> -Alan
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/nio-discuss/attachments/20170602/da84860e/attachment.html>
More information about the nio-discuss
mailing list