Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix file flush

  • Loading branch information...
commit 84c2ae88de2823daf3f15441c3fe634991fcb0a0 1 parent 74e354f
@yihuang authored
Showing with 4 additions and 2 deletions.
  1. +2 −1  plist2json.hs
  2. +2 −1  xml2json.hs
View
3  plist2json.hs
@@ -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
3  xml2json.hs
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.