On Wed, 14 Sep 2022 10:51:21 GMT, Jie Fu <ji...@openjdk.org> wrote: > I could reproduce the issue with `Files.createDirectories` on a macos with a > trivial program. It appears to be because of the use of `NOFOLLOW_LINKS` here > https://github.com/openjdk/jdk/blob/master/src/java.base/share/classes/java/nio/file/Files.java#L808. > To me this appears to be something that either needs to be clarified in the > the `Files.createDirectories` API or addressed/fixed there. I have asked for > inputs on this from others who have more knowledge of this area.
The specification is that symbolic links are followed by default, with a few exceptions (like delete and move) where it would be wrong to follow links. Files.createDirectories was originally intended to be like mkdir -p. We'd need to check the history but I suspect it is a long standing bug that createAndCheckIsDirectory opts out of following links. ------------- PR: https://git.openjdk.org/jdk/pull/10266