extra-1.8: Extra functions I use.
Safe HaskellNone
LanguageHaskell2010

System.Process.Extra

Description

Extra functions for creating processes. Specifically variants that automatically check the ExitCode and capture the stdout / stderr handles.

Synopsis

Documentation

proc :: FilePath -> [String] -> CreateProcess #

shell :: String -> CreateProcess #

data CreateProcess #

Constructors

CreateProcess 

Fields

Instances

Instances details
Show CreateProcess 
Instance details

Defined in System.Process.Common

Methods

showsPrec :: Int -> CreateProcess -> ShowS

show :: CreateProcess -> String

showList :: [CreateProcess] -> ShowS

Eq CreateProcess 
Instance details

Defined in System.Process.Common

data StdStream #

Instances

Instances details
Show StdStream 
Instance details

Defined in System.Process.Common

Methods

showsPrec :: Int -> StdStream -> ShowS

show :: StdStream -> String

showList :: [StdStream] -> ShowS

Eq StdStream 
Instance details

Defined in System.Process.Common

Methods

(==) :: StdStream -> StdStream -> Bool

(/=) :: StdStream -> StdStream -> Bool

system :: String -> IO ExitCode #

data CmdSpec #

Constructors

ShellCommand String 
RawCommand FilePath [String] 

Instances

Instances details
IsString CmdSpec 
Instance details

Defined in System.Process.Common

Methods

fromString :: String -> CmdSpec

Show CmdSpec 
Instance details

Defined in System.Process.Common

Methods

showsPrec :: Int -> CmdSpec -> ShowS

show :: CmdSpec -> String

showList :: [CmdSpec] -> ShowS

Eq CmdSpec 
Instance details

Defined in System.Process.Common

Methods

(==) :: CmdSpec -> CmdSpec -> Bool

(/=) :: CmdSpec -> CmdSpec -> Bool

createPipeFd :: IO (FD, FD) #

createProcess_ :: String -> CreateProcess -> IO (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle) #

getProcessExitCode :: ProcessHandle -> IO (Maybe ExitCode) #

callCommand :: String -> IO () #

callProcess :: FilePath -> [String] -> IO () #

cleanupProcess :: (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle) -> IO () #

getPid :: ProcessHandle -> IO (Maybe Pid) #

rawSystem :: String -> [String] -> IO ExitCode #

readCreateProcess :: CreateProcess -> String -> IO String #

readCreateProcessWithExitCode :: CreateProcess -> String -> IO (ExitCode, String, String) #

readProcess :: FilePath -> [String] -> String -> IO String #

readProcessWithExitCode :: FilePath -> [String] -> String -> IO (ExitCode, String, String) #

runInteractiveProcess :: FilePath -> [String] -> Maybe FilePath -> Maybe [(String, String)] -> IO (Handle, Handle, Handle, ProcessHandle) #

runProcess :: FilePath -> [String] -> Maybe FilePath -> Maybe [(String, String)] -> Maybe Handle -> Maybe Handle -> Maybe Handle -> IO ProcessHandle #

showCommandForUser :: FilePath -> [String] -> String #

withCreateProcess :: CreateProcess -> (Maybe Handle -> Maybe Handle -> Maybe Handle -> ProcessHandle -> IO a) -> IO a #

type Pid = CPid #

system_ :: Partial => String -> IO () Source #

A version of system that throws an error if the ExitCode is not ExitSuccess.

systemOutput :: String -> IO (ExitCode, String) Source #

A version of system that also captures the output, both stdout and stderr. Returns a pair of the ExitCode and the output.

systemOutput_ :: Partial => String -> IO String Source #

A version of system that captures the output (both stdout and stderr) and throws an error if the ExitCode is not ExitSuccess.