8181493: (fs) Files.readAttributes(path, BasicFileAttributes.class) should preserve nano second time stamps

Lance Andersen lance.andersen at oracle.com
Fri Jul 19 16:17:26 UTC 2019


Hi Brian
> On Jul 19, 2019, at 11:52 AM, Brian Burkhalter <brian.burkhalter at oracle.com> wrote:
> 
> 
>> On Jul 19, 2019, at 7:59 AM, Brian Burkhalter <brian.burkhalter at oracle.com <mailto:brian.burkhalter at oracle.com>> wrote:
>> 
>>> On Jul 19, 2019, at 4:14 AM, Alan Bateman <Alan.Bateman at oracle.com <mailto:Alan.Bateman at oracle.com>> wrote:
>>> 
>>> On the test then it would be better to use the scratch directory as Lance suggests. Also would be useful to have it run a few hundred times on all platforms before publish to be confident that it is reliable (we've had a lot of issues with tests for file time stamps as you know).
>> 
>> OK I will update the test and do a large number of test runs before pushing this.
> 
> Test updated as
> 
> --- a/test/jdk/java/nio/file/attribute/BasicFileAttributeView/SetTimesNanos.java
> +++ b/test/jdk/java/nio/file/attribute/BasicFileAttributeView/SetTimesNanos.java
> @@ -45,10 +45,10 @@
>      public static void main(String[] args) throws IOException,
>          InterruptedException {
>  
> -        Path dirPath = Path.of(System.getProperty("test.dir", "."), "test");
> +        Path dirPath = Path.of("test");
>          Path dir = Files.createDirectory(dirPath);
>          FileStore store = Files.getFileStore(dir);
> -        System.err.format("FileStore: %s on %s (%s)%n", dir, store.name(),
> +        System.out.format("FileStore: %s on %s (%s)%n", dir, store.name(),
>              store.type());
>          if (System.getProperty("os.name").toLowerCase().startsWith("mac") &&
>              store.name().equalsIgnoreCase("hfs")) {
> @@ -58,7 +58,7 @@
>          }
>          testNanos(dir);
>  
> -        Path file = Files.createTempFile(dir, "test", "test");
> +        Path file = Files.createFile(dir.resolve("test.dat"));
>          testNanos(file);
>      }

The update above looks good
> 
> Build-and-test job submitted; some test-only jobs to follow.
> 
> Brian

 <http://oracle.com/us/design/oracle-email-sig-198324.gif>
 <http://oracle.com/us/design/oracle-email-sig-198324.gif> <http://oracle.com/us/design/oracle-email-sig-198324.gif>
 <http://oracle.com/us/design/oracle-email-sig-198324.gif>Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037
Oracle Java Engineering 
1 Network Drive 
Burlington, MA 01803
Lance.Andersen at oracle.com <mailto:Lance.Andersen at oracle.com>



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/nio-dev/attachments/20190719/c28ca0f4/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: oracle_sig_logo.gif
Type: image/gif
Size: 658 bytes
Desc: not available
URL: <https://mail.openjdk.java.net/pipermail/nio-dev/attachments/20190719/c28ca0f4/oracle_sig_logo.gif>


More information about the nio-dev mailing list