Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
jberryman
GHC
Commits
b960cef5
Commit
b960cef5
authored
Sep 11, 2003
by
sof
Browse files
[project @ 2003-09-11 05:05:34 by sof]
hGetStringBuffer: open file in binary mode
parent
384a584a
Changes
1
Hide whitespace changes
Inline
Side-by-side
ghc/compiler/utils/StringBuffer.lhs
View file @
b960cef5
...
...
@@ -47,6 +47,11 @@ import GHC.IO ( slurpFile )
#endif
import IO ( openFile, hFileSize, IOMode(ReadMode) )
#if __GLASGOW_HASKELL__ >= 601
import System.IO ( openBinaryFile )
#else
import IOExts ( openFileEx, IOModeEx(..) )
#endif
#if __GLASGOW_HASKELL__ < 503
import IArray ( listArray )
...
...
@@ -62,6 +67,9 @@ import Data.Array.IO ( IOArray, hGetArray )
import Char ( ord )
#if __GLASGOW_HASKELL__ < 601
openBinaryFile fp mode = openFileEx fp (BinaryMode mode)
#endif
-- -----------------------------------------------------------------------------
-- The StringBuffer type
...
...
@@ -82,7 +90,7 @@ instance Show StringBuffer where
hGetStringBuffer :: FilePath -> IO StringBuffer
hGetStringBuffer fname = do
h <- openFile fname ReadMode
h <- open
Binary
File fname ReadMode
size <- hFileSize h
let size_i@(I# sz#) = fromIntegral size
#if __GLASGOW_HASKELL__ < 503
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment