RFR: 8356493: (fs) SecureDirectoryStream missing some capabilities [v2]

Benjamin Peterson duke at openjdk.org
Fri Sep 5 20:21:12 UTC 2025


On Fri, 5 Sep 2025 16:59:35 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

>>> In my particular application, the target is an absolute `Path`, so having to open another directory stream to pass as the target dir would be roundabout.
>> 
>> Thanks, that's helpful.
>
>> I think this may also need a `LinkOption` flag to pass `AT_FOLLOW_SYMLINKS`?
> 
> Adding `LinkOption.FOLLOW_LINKS` could be confusing when there is already `LinkOption.NOFOLLOW_LINKS`. For consistency with the `Files` APIs, it might be better to follow links by default (`AT_SYMLINK_FOLLOW`). Also, the macOS man page for `linkat` states
> 
> On OS X, not assigning AT_SYMLINK_FOLLOW to flag may result in
> some file systems returning an error.
> 
> which is not encouraging.

I agree that including `AT_SYMLINK_FOLLOW` by default and optionally taking `LinkOption.NOFOLLOW_LINKS` would be most consistent with the rest of the API.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26950#discussion_r2325969115


More information about the nio-dev mailing list