Bug in File.getLastModified()

Roger Riggs Roger.Riggs at Oracle.com
Fri Mar 31 15:17:49 UTC 2017


It would be interesting to know what operating system and file system 
this occurs on.
Any truncation would be due to the underlying OS and filesystem type.
Recall floppy drives, I vaguely recall that the filesystem only had per 
file info to a 1 second resolution.

$.02, Roger

On 3/31/2017 11:03 AM, Brian Burkhalter wrote:
> Hi Ricardo,
> Thanks for reading the specification verbiage closely. I think you have a point. I’d like to read what others think about this.
> Regards,
> Brian
> On Mar 31, 2017, at 1:35 AM, Ricardo Almeida <ric.almeida at gmail.com> wrote:
>> Just to add another though...
>> I was just double-reading the documentation and it says:
>> "All platforms support file-modification times to the nearest second,
>> but some provide more precision. The argument will be truncated to fit
>> the supported precision."
>> So, if the platform supports it, the argument is NOT truncated... Next we have:
>> "the next invocation of the lastModified() method will return the
>> (possibly truncated) time argument that was passed to this method"
>> The way I read this sentence, it is 100% related with the first
>> sentence. It should return the value that was applied... if the system
>> supports only second precision, it is truncated. Otherwise, it should
>> return the not truncated value.

More information about the core-libs-dev mailing list