2using System.ComponentModel;
5using System.Threading.Tasks;
20 public Task
CreateHardLink(
string targetPath,
string linkPath, CancellationToken cancellationToken)
21 =>
throw new NotSupportedException();
24 public Task
CreateSymbolicLink(
string targetPath,
string linkPath, CancellationToken cancellationToken) => Task.Factory.StartNew(
27 ArgumentNullException.ThrowIfNull(targetPath);
28 ArgumentNullException.ThrowIfNull(linkPath);
45 cancellationToken.ThrowIfCancellationRequested();
47 throw new Win32Exception();
51 TaskScheduler.Current);
IIOManager that resolves paths to Environment.CurrentDirectory.
const TaskCreationOptions BlockingTaskCreationOptions
The TaskCreationOptions used to spawn Tasks for potentially long running, blocking operations.
IFilesystemLinkFactory for windows systems.
Task CreateSymbolicLink(string targetPath, string linkPath, CancellationToken cancellationToken)
Create a symbolic link.A Task representing the running operation.
bool SymlinkedDirectoriesAreDeletedAsFiles
If directory symlinks must be deleted as files would in the current environment.This is because Linux...
Task CreateHardLink(string targetPath, string linkPath, CancellationToken cancellationToken)
Creates a hard link.A Task representing the running operation.
Native methods used by the code.
CreateSymbolicLinkFlags
See https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-createsymboliclinka#param...
static bool CreateSymbolicLink(string lpSymlinkFileName, string lpTargetFileName, CreateSymbolicLinkFlags dwFlags)
See https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-createsymboliclinkw.
For creating filesystem symbolic links.