use the binary model to read and write files, this can work correctly in windows with GNU c/c++ (mingw32)