ZVON > References > Haskell reference
| Indexes | Syntax | Prelude | Ratio | Complex | Numeric | Ix | Array | List | Maybe | Char | Monad | >> IO << | Directory | System | Time | Locale | CPUTime | Random

Module: IO
Function: hSetBuffering
Type: Handle -> BufferMode -> IO ()

Computation hSetBuffering hdl mode sets the mode of buffering for handle hdl on subsequent reads and writes.

    * If mode is LineBuffering, line-buffering is enabled if possible.
    * If mode is BlockBuffering size, then block-buffering is enabled if possible. The size of the buffer is n items if size is Just n and is otherwise implementation-dependent.
    * If mode is NoBuffering, then buffering is disabled if possible.

If the buffer mode is changed from BlockBuffering or LineBuffering to NoBuffering, then

    * if hdl is writable, the buffer is flushed as for hFlush;
    * if hdl is not writable, the contents of the buffer is discarded.

Example 1