19 public Task
CreateHardLink(
string targetPath,
string linkPath, CancellationToken cancellationToken) => Task.Factory.StartNew(
22 ArgumentNullException.ThrowIfNull(targetPath);
23 ArgumentNullException.ThrowIfNull(linkPath);
25 cancellationToken.ThrowIfCancellationRequested();
26 var fsInfo =
new UnixFileInfo(targetPath);
27 cancellationToken.ThrowIfCancellationRequested();
28 fsInfo.CreateLink(linkPath);
32 TaskScheduler.Current);
35 public Task
CreateSymbolicLink(
string targetPath,
string linkPath, CancellationToken cancellationToken) => Task.Factory.StartNew(
38 ArgumentNullException.ThrowIfNull(targetPath);
39 ArgumentNullException.ThrowIfNull(linkPath);
41 UnixFileSystemInfo fsInfo;
42 var isFile = File.Exists(targetPath);
43 cancellationToken.ThrowIfCancellationRequested();
45 fsInfo =
new UnixFileInfo(targetPath);
47 fsInfo =
new UnixDirectoryInfo(targetPath);
48 cancellationToken.ThrowIfCancellationRequested();
49 fsInfo.CreateSymbolicLink(linkPath);
53 TaskScheduler.Current);