From aaf3df7bb80d84d3870d8840c2935d4567f83f3c Mon Sep 17 00:00:00 2001 From: Brian Burkhalter Date: Thu, 21 Nov 2024 16:17:58 +0000 Subject: [PATCH] 8343823: (fs) Files.createLink: inconsistent behavior when creating link to symbolic link Reviewed-by: alanb --- src/java.base/share/classes/java/nio/file/Files.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/java.base/share/classes/java/nio/file/Files.java b/src/java.base/share/classes/java/nio/file/Files.java index 5dd8d219ba9..fa8ff8029e9 100644 --- a/src/java.base/share/classes/java/nio/file/Files.java +++ b/src/java.base/share/classes/java/nio/file/Files.java @@ -982,7 +982,10 @@ public final class Files { * The {@code existing} parameter is the path to an existing file. This * method creates a new directory entry for the file so that it can be * accessed using {@code link} as the path. On some file systems this is - * known as creating a "hard link". Whether the file attributes are + * known as creating a "hard link". If the {@code existing} parameter + * is the path to a symbolic link, then whether the new link is for the + * target of the symbolic link or for the symbolic link itself is platform + * dependent and therefore not specified. Whether the file attributes are * maintained for the file or for each directory entry is file system * specific and therefore not specified. Typically, a file system requires * that all links (directory entries) for a file be on the same file system.