Skip to content

Instantly share code, notes, and snippets.

@trendoid
Last active December 2, 2021 19:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trendoid/ad4c5f3b58fc09c6a0ee472a0fd869d6 to your computer and use it in GitHub Desktop.
Save trendoid/ad4c5f3b58fc09c6a0ee472a0fd869d6 to your computer and use it in GitHub Desktop.
// For more information see https://aka.ms/fsharp-console-apps
printfn "Console App: Started!"
open System.IO
let baseDirectory = __SOURCE_DIRECTORY__
let filePath = "Text.txt"
let fullPath = Path.Combine(baseDirectory, filePath)
let readFilesTask (path1) =
task {
let! content = File.ReadAllTextAsync(path1)
return content
}
printfn "Content: %s" (readFilesTask(fullPath).Result)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment