SymbolicLink

README
Login

README

SymbolicLink is a small utility library that provides cross-platform support for symbolic links.

Installation

You can install SymbolicLink via NuGet or download a binary release.

To build SymbolicLink from source you will need an F# 4.1 compiler (or newer) and a .NET development environment. The .sln and .fsproj files in the source directories should be understood by .NET Core command line tools, MSBuild or IDEs such as VSCode or VisualStudio.

Usage

SymbolicLink is a library. The Murphy.SymbolicLink namespace contains a SymbolicLink module and several extension methods for classes in the System.IO namespace.

Here are some usage examples for the library:

#r "Murphy.SymbolicLink"
open System
open Murphy.SymbolicLink

// Create a new symbolic link "a" that points to "b":
SymbolicLink.create "b" "a"
IO.File.CreateSymbolicLink("a", "b")

// Resolve all links in the path "a":
SymbolicLink.resolve "a" |> printfn "a -> %s"
IO.Path.GetResolvedPath("a") |> printfn "a -> %s"

// Read the target of the symbolic link "a":
SymbolicLink.read "a"
|> function
  | Ok target -> printfn "a -> %s" target
  | Error err -> eprintfn "%O" err

try
  IO.File.ReadSymbolicLink("a")
  |> printfn "a -> %s"
with
| err -> eprintfn "%O" err