Comparing file contents in F#
- by Bartosz Milewski
I wrote a quick and dirty function to compare file contents (BTW, I have already tested that they are of equal size):
let eqFiles f1 f2 =
let bytes1 = Seq.ofArray (File.ReadAllBytes f1)
let bytes2 = Seq.ofArray (File.ReadAllBytes f2)
let res = Seq.compareWith (fun x y -> (int x) - (int y)) bytes1 bytes2
res = 0
I'm not happy with…