Created
January 20, 2012 03:27
-
-
Save akovbovich/1644790 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 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