ensure that the file is opened in the binary mode