Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Compilation fixes for Scan.hs

  • Loading branch information...
commit b0707ca58bea1f810966e641e351ae500542083c 1 parent fa65209
@jgoerzen authored
Showing with 10 additions and 5 deletions.
  1. +5 −2 Commands/Scan.hs
  2. +5 −3 Utils.hs
View
7 Commands/Scan.hs
@@ -21,6 +21,7 @@ import System.Console.GetOpt.Utils
import System.Cmd.Utils
import Utils
import HSH
+import System.IO
cmd = simpleCmd "scan"
"Read a plain tar file and produce an index file for it" helptext
@@ -28,8 +29,10 @@ cmd = simpleCmd "scan"
cmd_worker
cmd_worker ([], []) = bracketFIFO "tarf-scan.XXXXXX" $ \fifoname ->
- do progname <- getProgram "tarf-encoder"
- runIO $ ("tarf-encoder", ["cat", fifoname]) -|-
+ do hSetBuffering stdin (BlockBuffering (Just 10240))
+ hSetBuffering stdout LineBuffering
+ progname <- getProgram "tarf-encoder"
+ runIO $ (progname, ["cat", fifoname]) -|-
discard -|- catFromBS [fifoname]
cmd_worker _ =
View
8 Utils.hs
@@ -22,6 +22,7 @@ import System.Environment
import HSH
import System.Path
import System.Posix.Files(createNamedPipe)
+import System.Directory(getTemporaryDirectory)
data Command =
Command {cmdname :: String,
@@ -61,8 +62,9 @@ getProgram x =
bracketFIFO :: String -> (String -> IO a) -> IO a
bracketFIFO pattern func =
- brackettmpdir pattern fifofunc
- where fifofunc dirname =
- let fifoname = dirname ++ "/" ++ "fifo"
+ do tmpdir <- getTemporaryDirectory
+ brackettmpdir (tmpdir ++ "/" ++ pattern) fifofunc
+ where fifofunc tmpdirname =
+ let fifoname = tmpdirname ++ "/" ++ "fifo"
in do createNamedPipe fifoname 0o600
func fifoname
Please sign in to comment.
Something went wrong with that request. Please try again.