[Haskell-cafe] Haskore

Bulat Ziganshin bulat.ziganshin at gmail.com
Fri Sep 22 06:05:22 EDT 2006


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 at gmail.com



More information about the Haskell-Cafe mailing list