on windows, must open file in O_BINARY