writeFile should use openBinaryFile
|Reported by:||Tinctorius||Owned by:|
|Type of failure:||None/Unknown||Test Case:|
|Related Tickets:||Differential Rev(s):|
Apparently, I can't use
writeFile to write binary data to a file in Windows:
Prelude Codec.Binary.Base64.String Data.Char> readFile "foo.txt" >>= return . decode . filter isAlphaNum >>= writeFile "foo.dat" *** Exception: .../foo.dat: commitBuffer: invalid argument (character is not in the code page)
This is clearly because
openFile opens the file with newline translation etc. (why would you ever want this by default? D:).
writeFile does not mention this behaviour in its documentation.