
With this function:
module Main where
import IO
main :: IO() main = do hSetBuffering stdout (BlockBuffering (Just 3)) putStr ("abcdefgh" ++ inf)
inf = inf
nhc98 produces no output. The library report says: For output, items are written out, or flushed, from the internal buffer according to the buffer mode: * block-buffering: the entire buffer is written out whenever it overflows, a hFlush is issued, or the handle is closed. An implementation is free to flush the buffer more frequently, but not less frequently, than specified above. Thanks Ian

With this function:
main :: IO() main = do hSetBuffering stdout (BlockBuffering (Just 3)) putStr ("abcdefgh" ++ inf) inf = inf
nhc98 produces no output.
Thanks for the bug report. Patch below. Regards, Malcolm Index: src/runtime/Builtin/cHPutStr.c =================================================================== RCS file: /usr/src/master/nhc/src/runtime/Builtin/cHPutStr.c,v retrieving revision 1.6 diff -u -r1.6 cHPutStr.c --- src/runtime/Builtin/cHPutStr.c 2001/06/18 13:29:30 1.6 +++ src/runtime/Builtin/cHPutStr.c 2001/11/28 12:26:10 @@ -225,6 +225,7 @@ } /* *dstptr = '\0'; */ err = fwrite(buf,sizeof(char),reqsize,f->fp); + err = fflush(f->fp); } }
participants (2)
-
Ian Lynagh
-
Malcolm Wallace