
22 Sep
2006
22 Sep
'06
10:05 a.m.
Hello David, Friday, September 22, 2006, 1:40:31 PM, you wrote:
openBinaryFile :: FilePath -> IOMode -> IO Handle
import System.IO
writeBinaryFile :: FilePath -> String -> IO () writeBinaryFile f txt = bracket (openBinaryFile f WriteMode) hClose (\hdl -> hPutStr hdl txt)
readBinaryFile :: FilePath -> IO String readBinaryFile name = openBinaryFile name ReadMode >>= hGetContents
these definitions will work both on unix and win -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com