-
-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add symlink support #85
Conversation
Looks great, thanks! I'm thinking that if we want to add this, we might want also to add File.ResolveLinkTarget as part of this PR? The API would be similar, but taking a |
I've added the API, can you validate if this is how you want the API? interface IFileSystem
{
/// <summary>
/// Resolves the target of a symbolic link.
/// </summary>
/// <param name="linkPath">The path of the symbolic link to resolve.</param>
UPath? ResolveLinkTarget(UPath linkPath);
} I wasn't sure about the return type, since the following is possible:
Other than the return type: the only thing I'll have to validate if the MountFileSystem and SubFileSystem are returning the correct path. |
Maybe something like this instead? interface IFileSystem
{
/// <summary>
/// Resolves the target of a symbolic link.
/// </summary>
/// <param name="linkPath">The path of the symbolic link to resolve.</param>
/// <param name="resolvedPath">The path of the symbolic link resolved if true is returned.</param>
bool TryResolveLinkTarget(UPath linkPath, out UPath resolvedPath);
} |
Thanks! |
Fixes #74
This PR implements
IFileSystem.CreateSymbolicLink(UPath path, UPath pathToTarget)
Linux
OS: Ubuntu 20.04 focal
Kernel: x86_64 Linux 5.10.102.1-microsoft-standard-WSL2
After adding .NET 6.0 to the targets (to validate the .NET Standard 2.1 implementation):
Windows
OS: Windows 11 23H2
Note: needs to be tested with administrator rights