RFR: 8364277: (fs) BasicFileAttributes.isDirectory and isOther return true for NTFS directory junctions when links not followed

Alan Bateman alanb at openjdk.org
Tue Aug 5 06:56:10 UTC 2025


On Mon, 4 Aug 2025 21:38:34 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

> Change `BasicFileAttributes` for Windows such that for a directory junction `isOther` returns `true` but all other `is*` methods return `false`. Without this change, `isDirectory` also returns `true`.

On the surface, treating a NTFS directory junction as "other" make sense as they don't fit the file kinds known to the platform. The only reparse points that the JDK can sensibly deal with are symbolic links and Unix domain socket files.

My main concern is what might be depending on existing behavior and what inconsistencies will surface if we change this. Would it be possible to enumerate how some of the APIs behave before+after this change? I'm specifically wondering about toRealPath and Files.list/walk behave now and how they will behave with the change.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/26631#issuecomment-3153735203


More information about the core-libs-dev mailing list