Last active
April 23, 2019 09:57
-
-
Save SchlenkR/f56fcf09080e8c7244241932f8822732 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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