Skip to content

Use BCL APIs to resolve link targets.#14482

Draft
teo-tsirpanis wants to merge 1 commit into
dotnet:mainfrom
teo-tsirpanis:symlink-target-bcl
Draft

Use BCL APIs to resolve link targets.#14482
teo-tsirpanis wants to merge 1 commit into
dotnet:mainfrom
teo-tsirpanis:symlink-target-bcl

Conversation

@teo-tsirpanis

Copy link
Copy Markdown
Contributor

Fixes #

Context

#13752 had to resolve paths to symlinks, and did it by P/Invoking to realpath(3), while there is the File.ResolveLinkTarget method in the BCL. This PR moves to using it.

Changes Made

  • Removed NativeMethods.RealPath and related P/Invoke definitions.
  • Replaced uses with File.ResolveLinkTarget.
    • This API exists only in modern .NET, but so was NativeMethods.RealPath. The body of the only method using this API was covered in #if NET.
      • Also added some nullable annotations to this method.

Testing

Notes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant