Why eat my "\r" at windows?

a = (“abc” * 20 + “\r\n”) * 3
File.open(“a.txt”, “wb” ){|x| x.write a}

s = open(“a.txt”).read
p s.count("\r") # why == 0 ?

Your second open opens it (in default) in non binary mode, so it
translates “\r\n” to “\n”