8220793: (fs) No support for changing modification time of symlink

Brian Burkhalter brian.burkhalter at oracle.com
Thu May 2 15:03:49 UTC 2019


> On May 1, 2019, at 11:20 PM, Alan Bateman <Alan.Bateman at oracle.com> wrote:
> 
> I think the test should skip if TestUtil.supportsLinks returns false as otherwise it will fail on Windows machines when the user doesn't have the appropriate privileges.

Something like this?:

--- a/test/jdk/java/nio/file/Files/SymlinkTime.java
+++ b/test/jdk/java/nio/file/Files/SymlinkTime.java
@@ -41,6 +41,12 @@
 public class SymlinkTime {
     public static void main(String[] args) throws IOException {
         Path dir = TestUtil.createTemporaryDirectory();
+        if (System.getProperty("os.name").startsWith("Windows") &&
+            !TestUtil.supportsLinks(dir)) {
+            System.out.println("Windows: links not supported - skipping test");
+            return;
+        }
+
         try {
             // Create file and symbolic link to it
             final Path file = dir.resolve("file");

Thanks,

Brian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/nio-dev/attachments/20190502/14115f31/attachment-0001.html>


More information about the nio-dev mailing list