I came across this problem today. I was attempting to create a new binary file using Ruby and tried the following:
File.new(”picture.jpg”, “w”)
While this worked on the *nix os, it resulted in a corrupt binary file when run in WINXP.
Solution
To create a binary file in ruby you will need to include the “wb” option. See below.
File.new(”picture.jpg”, “wb”)
Bye!