Open file in binary mode so that Windows don't mangle the binary format output file.