Skip to content

Instantly share code, notes, and snippets.

@SchlenkR
Last active April 23, 2019 09:57
Show Gist options
  • Save SchlenkR/f56fcf09080e8c7244241932f8822732 to your computer and use it in GitHub Desktop.
Save SchlenkR/f56fcf09080e8c7244241932f8822732 to your computer and use it in GitHub Desktop.
open System.IO
let curry (f: (_ * _ -> _)) a b = f (a,b)
let curry2 = curry
let curry3 (f: (_ * _ * _ -> _)) a b c = f (a,b,c)
let curry4 (f: (_ * _ * _ * _ -> _)) a b c d = f (a,b,c,d)
let ( <+> ) a b = Path.Combine(a, b)
let rec copyDirectory srcPath destPath =
if Directory.Exists destPath |> not then
Directory.CreateDirectory destPath |> ignore
let srcDir = DirectoryInfo(srcPath)
for file in srcDir.GetFiles() do
let tempPath = destPath <+> file.Name
printfn "Copying '%s' to '%s'." file.Name tempPath
file.CopyTo(tempPath, true) |> ignore
for subdir in srcDir.GetDirectories() do
copyDirectory subdir.FullName (destPath <+> subdir.Name)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment