[project @ 2003-12-04 18:25:51 by panne]
[ghc-base.git] / GHC / Handle.hs
index e790ae3..d1f026c 100644 (file)
@@ -441,7 +441,8 @@ flushReadBuffer fd buf
      return buf{ bufWPtr=0, bufRPtr=0 }
 
 flushWriteBuffer :: FD -> Bool -> Buffer -> IO Buffer
-flushWriteBuffer fd is_stream buf@Buffer{ bufBuf=b, bufRPtr=r, bufWPtr=w }  = do
+flushWriteBuffer fd is_stream buf@Buffer{ bufBuf=b, bufRPtr=r, bufWPtr=w }  =
+  seq fd $ do -- strictness hack
   let bytes = w - r
 #ifdef DEBUG_DUMP
   puts ("flushWriteBuffer, fd=" ++ show fd ++ ", bytes=" ++ show bytes ++ "\n")
@@ -635,8 +636,8 @@ addFilePathToIOError fun fp (IOError h iot _ str _)
 -- Some operating systems delete empty files, so there is no guarantee
 -- that the file will exist following an 'openFile' with @mode@
 -- 'WriteMode' unless it is subsequently written to successfully.
--- The handle is positioned at the end of the file if `mode' is
--- `AppendMode', and otherwise at the beginning (in which case its
+-- The handle is positioned at the end of the file if @mode@ is
+-- 'AppendMode', and otherwise at the beginning (in which case its
 -- internal position is 0).
 -- The initial buffer mode is implementation-dependent.
 --
@@ -936,7 +937,7 @@ isEOF = hIsEOF stdin
 -- ---------------------------------------------------------------------------
 -- Looking ahead
 
--- | Computation 'hLookahead' returns the next character from the handle
+-- | Computation 'hLookAhead' returns the next character from the handle
 -- without removing it from the input buffer, blocking until a character
 -- is available.
 --
@@ -970,7 +971,7 @@ hLookAhead handle = do
 -- further explanation of what the type represent.
 
 -- | Computation 'hSetBuffering' @hdl mode@ sets the mode of buffering for
--- handle hdl on subsequent reads and writes.
+-- handle @hdl@ on subsequent reads and writes.
 --
 -- If the buffer mode is changed from 'BlockBuffering' or
 -- 'LineBuffering' to 'NoBuffering', then
@@ -1037,7 +1038,7 @@ hSetBuffering handle mode =
 -- hFlush
 
 -- | The action 'hFlush' @hdl@ causes any items buffered for output
--- in handle `hdl' to be sent immediately to the operating system.
+-- in handle @hdl@ to be sent immediately to the operating system.
 --
 -- This operation may fail with:
 --