static void UnlinkDirectory(DirectoryInfo directory) { var link = Symlink.FromPath(directory.FullName); if (link.Exists) { link.Delete(); } }
static void LinkDirectory(DirectoryInfo directory, string destination) { var link = Symlink.FromPath(directory.FullName); if (link.Exists) { link.DestinationPath = destination; } else { if (directory.Exists) { directory.Delete(true); } link.Create(destination); } }