|
|
|
|
|
Description |
functions for killing processes, running processes, etc
|
|
Synopsis |
|
simpleProcess :: FilePath -> [String] -> IO (String, String, ExitCode) | | processResult :: FilePath -> [String] -> IO (Either Int (String, String)) | | processOutput :: FilePath -> [String] -> IO (Either Int String) | | simpleCommand :: String -> IO (String, String, ExitCode) | | commandResult :: String -> IO (Either Int (String, String)) | | commandOutput :: String -> IO (Either Int String) | | type Process = (Handle, Handle, Handle, ProcessHandle) | | | | lazyRun :: ByteString -> Process -> IO [Output] | | lazyCommand :: String -> ByteString -> IO [Output] | | lazyProcess :: FilePath -> [String] -> Maybe FilePath -> Maybe [(String, String)] -> ByteString -> IO [Output] | | stdoutOnly :: [Output] -> ByteString | | stderrOnly :: [Output] -> ByteString | | outputOnly :: [Output] -> ByteString | | checkResult :: (Int -> a) -> a -> [Output] -> a | | discardStdout :: [Output] -> [Output] | | discardStderr :: [Output] -> [Output] | | discardOutput :: [Output] -> [Output] | | mergeToStderr :: [Output] -> [Output] | | mergeToStdout :: [Output] -> [Output] | | collectStdout :: [Output] -> (ByteString, [Output]) | | collectStderr :: [Output] -> (ByteString, [Output]) | | collectOutput :: [Output] -> (ByteString, ByteString, [ExitCode]) | | collectOutputUnpacked :: [Output] -> (String, String, [ExitCode]) | | | | exitCodeOnly :: [Output] -> [ExitCode] | | hPutNonBlocking :: Handle -> ByteString -> IO Int64 | | killByCwd :: FilePath -> IO [(String, Maybe String)] |
|
|
|
Strict process running
|
|
|
simpleProcess - run a process returning (stdout, stderr, exitcode)
Warning - stdout and stderr will be read strictly so that we do
not deadlock when trying to check the exitcode. Do not try doing
something like, simpleProcess ["yes"]
NOTE: this may still dead-lock because we first strictly read
outStr and then errStr. Perhaps we should use forkIO or something?
|
|
|
|
|
|
|
|
|
|
|
|
Lazy process running
|
|
|
This is the type returned by runInteractiveProcess et. al.
|
|
|
The process returns a list of objects of type Output. There will be
one Result object at the end of the list (if the list has an end.)
| Constructors | |
|
|
|
Take the tuple like that returned by runInteractiveProcess,
create a process, send the list of inputs to its stdin and return
the lazy list of Output objects.
|
|
|
Current verbosity level.
Create a process with runInteractiveCommand and run it with lazyRun.
|
|
|
Create a process with runInteractiveProcess and run it with lazyRun.
|
|
|
Filter everything except stdout from the output list.
|
|
|
Filter everything except stderr from the output list.
|
|
|
Filter the exit codes output list and merge the two output
streams in the order they appear.
|
|
|
|
|
|
|
|
|
|
|
Turn all the Stdout text into Stderr, preserving the order.
|
|
|
Turn all the Stderr text into Stdout, preserving the order.
|
|
|
Split out and concatenate Stdout
|
|
|
Split out and concatenate Stderr
|
|
|
Split out and concatenate both Stdout and Stderr, leaving only the exit code.
|
|
|
Collect all output, unpack and concatenate.
|
|
|
Constructors | ExitSuccess | indicates successful termination;
| ExitFailure Int | indicates program failure with an exit code.
The exact interpretation of the code is
operating-system dependent. In particular, some values
may be prohibited (e.g. 0 on a POSIX-compliant system).
|
|
|
|
|
Filter everything except the exit code from the output list.
|
|
|
This belongs in Data.ByteString. See ticket 1070,
http://hackage.haskell.org/trac/ghc/ticket/1070.
|
|
Process killing
|
|
|
Kill the processes whose working directory is in or under the
given directory.
|
|
Produced by Haddock version 2.6.1 |