Skip to content

Instantly share code, notes, and snippets.

@akovbovich
Created January 20, 2012 03:27
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 akovbovich/1644790 to your computer and use it in GitHub Desktop.
Save akovbovich/1644790 to your computer and use it in GitHub Desktop.
open System.IO
let openFile =
async { use fs = new FileStream(@"C:\Program Files\Internet Explorer\iexplore.exe",
FileMode.Open, FileAccess.Read, FileShare.Read)
let data = Array.create (int fs.Length) 0uy
let! bytesRead = fs.ReadAsync(data, 0, data.Length)
do printfn "Read Bytes: %i, First bytes were: %i %i %i ..."
bytesRead data.(1) data.(2) data.(3) }
Async.Run openFile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment