Re: Bug in File.getLastModified()

2017-04-03 Thread Ricardo Almeida
Hi all, I agree with Sean, as said in the bug. The reason we have in the documentation that it can be possibly truncated is most likely related to older linux's that wouldn't support it... If the data is there and available, why explicitly truncate it? Also note that the workaround also doesn't

Re: Bug in File.getLastModified()

2017-04-03 Thread Ricardo Almeida
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

Re: Bug in File.getLastModified()

2017-03-31 Thread Seán Coffey
Hi Brian, I think it's worth fixing unless there are objections. I see Stuart's comment about compatibility and wonder if we've any examples of such applications. I just put together a patch [1] for this. I'm still figuring out how nanoseconds get recorded for macosx.

Re: Bug in File.getLastModified()

2017-03-31 Thread Roger Riggs
Hi, 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

Re: Bug in File.getLastModified()

2017-03-31 Thread Brian Burkhalter
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 wrote: > Just to add another though... > > I was just

Re: Bug in File.getLastModified()

2017-03-30 Thread Brian Burkhalter
As noted in [1], it looks like the specification [2] already dealt with the situation via the "possibly truncated" phrase: "If the operation succeeds and no intervening operations on the file take place, then the next invocation of the lastModified() method will return the (possibly

Re: Bug in File.getLastModified()

2017-03-30 Thread Seán Coffey
Ricardo, I see that JDK-8177809[1] has been logged. The newer NIO APIs can report back with higher time precision and it's probably best to use those. JDK-6939260 is related to your issue also. Returning a ms value not equal to the ms value used in the setLastModified call does seem

Re: Bug in File.getLastModified()

2017-03-29 Thread David Holmes
Hi Ricardo, This isn't a build issue. Redirecting to core-libs-dev. Please don't reply to build-dev. Thanks, David On 30/03/2017 12:40 AM, Ricardo Almeida wrote: Hi, I could not raise a bug in https://bugs.openjdk.java.net/ so I hope it is ok to say it here, hoping someone can take a look