Permalink
Browse files

Flush after writing to handles.

  • Loading branch information...
1 parent 65e4b14 commit fe3e26f2d6a6a66e2efa234ed8752d98f7505216 @steveWang committed Aug 27, 2012
Showing with 2 additions and 6 deletions.
  1. +2 −6 src/bifurcate.hs
View
8 src/bifurcate.hs
@@ -2,8 +2,6 @@ import System.Environment
import System.Process
import System.IO
--- TODO : wait until all files are closed.
-
process :: String -> String -> IO Handle
process "a" fname = do
x <- openFile fname AppendMode
@@ -28,12 +26,10 @@ parseArgs (('-': hd) : tl) = collect hd tl
multicast :: [IO Handle] -> String -> IO ()
multicast [] c = do
return ()
-multicast [x] c = do
- hdl <- x
- hPutStr hdl c
multicast (x : xs) c = do
hdl <- x
- tmp <- hPutStr hdl c
+ hPutStr hdl c
+ hFlush hdl
multicast xs c
main :: IO ()

0 comments on commit fe3e26f

Please sign in to comment.