From 354f17ec86e2e11f2e77a159916b2e7be74979c9 Mon Sep 17 00:00:00 2001 From: simonpj Date: Fri, 8 Mar 2002 15:42:12 +0000 Subject: [PATCH] [project @ 2002-03-08 15:42:12 by simonpj] Read and write interfaces in binary mode; important for Win32 --- ghc/compiler/utils/Binary.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ghc/compiler/utils/Binary.hs b/ghc/compiler/utils/Binary.hs index bdad7c3..207394b 100644 --- a/ghc/compiler/utils/Binary.hs +++ b/ghc/compiler/utils/Binary.hs @@ -220,7 +220,7 @@ isEOFBin (BinIO _ ix_r h) = hIsEOF h writeBinMem :: BinHandle -> FilePath -> IO () writeBinMem (BinIO _ _ _) _ = error "Data.Binary.writeBinMem: not a memory handle" writeBinMem (BinMem _ ix_r sz_r arr_r) fn = do - h <- openFile fn WriteMode + h <- openFileEx fn (BinaryMode WriteMode) arr <- readIORef arr_r ix <- readFastMutInt ix_r hPutArray h arr ix @@ -234,7 +234,7 @@ writeBinMem (BinMem _ ix_r sz_r arr_r) fn = do readBinMem :: FilePath -> IO BinHandle readBinMem filename = do - h <- openFile filename ReadMode + h <- openFileEx filename (BinaryMode ReadMode) filesize' <- hFileSize h let filesize = fromIntegral filesize' arr <- newArray_ (0,filesize-1) -- 1.7.10.4