diff options
author | sof <unknown> | 1998-11-23 15:44:25 +0000 |
---|---|---|
committer | sof <unknown> | 1998-11-23 15:44:25 +0000 |
commit | bbe9c55569ffa1ea660a02d7349afb4ba659072d (patch) | |
tree | 7b8e6b964012cdda16a1bdf2b092719cc0d04af7 /ghc/lib/std/cbits/writeFile.lc | |
parent | 9a13d5c84f7467ea29fc7e50b7257585e9c1cee7 (diff) | |
download | haskell-bbe9c55569ffa1ea660a02d7349afb4ba659072d.tar.gz |
[project @ 1998-11-23 15:44:21 by sof]
Extend hConnectTo to also allow output handles to be connected, i.e.,
h1 <- openFile "foo" WriteMode
h2 <- openFile "bar" WriteMode
hConnectTo h1 h2
will cause h1's buffer to be flushed when h2's buffer overflows
(and it is just about to be flushed.) The implementation is currently
not as lazy as that, it flushes h1's buffer regardless of whether h2's
buffer overflows or not.
This is used to connect 'stderr' and 'stdout', i.e., output on
'stderr' will now cause 'stdout' output to (first) be flushed.
Diffstat (limited to 'ghc/lib/std/cbits/writeFile.lc')
-rw-r--r-- | ghc/lib/std/cbits/writeFile.lc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/ghc/lib/std/cbits/writeFile.lc b/ghc/lib/std/cbits/writeFile.lc index ca7bac63d4..1cd336e71d 100644 --- a/ghc/lib/std/cbits/writeFile.lc +++ b/ghc/lib/std/cbits/writeFile.lc @@ -76,6 +76,7 @@ StgInt len; if (len == 0 ) return 0; + /* First of all, check if we do need to flush the buffer .. */ /* Note - in the case of line buffering, we do not currently check whether we need to flush buffer due to line terminators in the |