bugfix: Use openBinaryFile in Data.Binary.decodeFile. It makes difference only on Windows

This commit is contained in:
krasimir
2009-06-24 12:07:38 +00:00
parent cf4efe0acc
commit f81a309eb1

View File

@@ -271,7 +271,7 @@ encodeFile f v = L.writeFile f (encode v)
-- or otherwise finalise the resource. -- or otherwise finalise the resource.
-- --
decodeFile :: Binary a => FilePath -> IO a decodeFile :: Binary a => FilePath -> IO a
decodeFile f = bracket (openFile f ReadMode) hClose $ \h -> do decodeFile f = bracket (openBinaryFile f ReadMode) hClose $ \h -> do
s <- L.hGetContents h s <- L.hGetContents h
evaluate $ runGet (do v <- get evaluate $ runGet (do v <- get
m <- isEmpty m <- isEmpty