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

Benjamin Peterson duke at openjdk.org
Thu Sep 4 21:59:29 UTC 2025


On Thu, 4 Sep 2025 20:41:46 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

>>> > This method was intended to mirror `File.createLink` which does not have this option.
>>> 
>>> Probably because `link(2)` always follows symlinks?
>> 
>> Good point. I should revise this. Thanks.
>
>> Maybe the usability of simple cases would be improved by a `createLink(T link, T target)` overload (that passed `olddirfd=AT_FDCWD` to the underlying syscall)?
> 
> This could also be accomplished by passing as `targetdir` a `SecureDirectoryStream` created for the `Path` of `System.getProperty("user.dir")`.
> 
> I suppose it depends on how common the case is as to whether a convenience method is worthwhile.

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.

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

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


More information about the nio-dev mailing list