33 public Task
CreateHardLink(
string targetPath,
string linkPath, CancellationToken cancellationToken) => Task.Factory.StartNew(
36 ArgumentNullException.ThrowIfNull(targetPath);
37 ArgumentNullException.ThrowIfNull(linkPath);
39 cancellationToken.ThrowIfCancellationRequested();
40 var fsInfo =
new UnixFileInfo(targetPath);
41 cancellationToken.ThrowIfCancellationRequested();
42 fsInfo.CreateLink(linkPath);
46 TaskScheduler.Current);
49 public Task
CreateSymbolicLink(
string targetPath,
string linkPath, CancellationToken cancellationToken) => Task.Factory.StartNew(
52 ArgumentNullException.ThrowIfNull(targetPath);
53 ArgumentNullException.ThrowIfNull(linkPath);
55 UnixFileSystemInfo fsInfo;
56 var isFile =
fileSystem.File.Exists(targetPath);
57 cancellationToken.ThrowIfCancellationRequested();
59 fsInfo =
new UnixFileInfo(targetPath);
61 fsInfo =
new UnixDirectoryInfo(targetPath);
62 cancellationToken.ThrowIfCancellationRequested();
63 fsInfo.CreateSymbolicLink(linkPath);
67 TaskScheduler.Current);