Permalink
Browse files

Fix file flush

  • Loading branch information...
yihuang committed Oct 14, 2012
1 parent 74e354f commit 84c2ae88de2823daf3f15441c3fe634991fcb0a0
Showing with 4 additions and 2 deletions.
  1. +2 −1 plist2json.hs
  2. +2 −1 xml2json.hs
View
@@ -1,6 +1,6 @@
{-# LANGUAGE OverloadedStrings, TupleSections #-}
import System.Environment (getArgs)
-import System.IO (stdin, stdout, openFile, IOMode(..))
+import System.IO (stdin, stdout, openFile, IOMode(..), hFlush)
import System.Exit (exitSuccess)
import Control.Applicative
import Data.Conduit
@@ -23,3 +23,4 @@ main = do
tokens <- runResourceT $ C.sourceHandle hInput $= tokenStreamBS $$ C.consume
L.hPutStrLn hOutput $ encode $ tokensToJSON tokens
+ hFlush hOutput
View
@@ -1,6 +1,6 @@
{-# LANGUAGE OverloadedStrings, TupleSections #-}
import System.Environment (getArgs)
-import System.IO (stdin, stdout, openFile, IOMode(..))
+import System.IO (stdin, stdout, openFile, IOMode(..), hOutput)
import System.Exit (exitSuccess)
import Control.Applicative
import Data.Conduit
@@ -22,3 +22,4 @@ main = do
_ -> putStrLn "xml2json [input] [output]" >> exitSuccess
tokens <- runResourceT $ C.sourceHandle hInput $= tokenStreamBS $$ C.consume
L.hPutStrLn hOutput $ encode $ tokensToJSON tokens
+ hFlush hOutput

0 comments on commit 84c2ae8

Please sign in to comment.