| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Procex.Process
Description
This module wraps over the API in Procex.Core in a user-friendly way.
Synopsis
- makeCmd :: ByteString -> Cmd
- newtype CmdException = CmdException ProcessStatus
- run :: Cmd -> IO ()
- pipeArgIn :: Fd -> Cmd -> Cmd -> Cmd
- pipeArgOut :: Fd -> Cmd -> Cmd -> Cmd
- pipeHIn :: Fd -> (Async ProcessStatus -> Handle -> IO ()) -> Cmd -> Cmd
- pipeHOut :: Fd -> (Async ProcessStatus -> Handle -> IO ()) -> Cmd -> Cmd
- pipeIn :: Fd -> Fd -> Cmd -> Cmd -> Cmd
- pipeOut :: Fd -> Fd -> Cmd -> Cmd -> Cmd
- pipeArgHIn :: (Async ProcessStatus -> Handle -> IO ()) -> Cmd -> Cmd
- pipeArgHOut :: (Async ProcessStatus -> Handle -> IO ()) -> Cmd -> Cmd
- captureFdsAsHandles :: [Fd] -> Cmd -> IO (Async ProcessStatus, [Handle])
- waitCmd :: Async ProcessStatus -> IO ()
Documentation
makeCmd :: ByteString -> Cmd Source #
A version of makeCmd' that resolves the path
according to PATH and passes through stdin, stdout and stderr (unless overrided).
newtype CmdException Source #
Thrown when the return code of a command isn't 0.
Constructors
| CmdException ProcessStatus |
Instances
| Exception CmdException Source # | |
Defined in Procex.Process Methods toException :: CmdException -> SomeException # fromException :: SomeException -> Maybe CmdException # displayException :: CmdException -> String # | |
| Show CmdException Source # | |
Defined in Procex.Process Methods showsPrec :: Int -> CmdException -> ShowS # show :: CmdException -> String # showList :: [CmdException] -> ShowS # | |
Runs a command synchronously. See also run'.
CmdException will be thrown if the command fails.
Arguments
| :: Fd | The fd the command will write to |
| -> Cmd | The command that will write to the fd |
| -> Cmd | The command you're modifying |
| -> Cmd |
Pass an argument of the form /proc/self/fd/<n> to the process,
where n is the reader end of a pipe which the command
writes to through the specified fd.
Arguments
| :: Fd | The fd the command will read from |
| -> Cmd | The command that will read from the fd |
| -> Cmd | The command you're modifying |
| -> Cmd |
Pass an argument of the form /proc/self/fd/<n> to the process,
where n is the writer end of a pipe which the command
reads from through the specified fd.
pipeHIn :: Fd -> (Async ProcessStatus -> Handle -> IO ()) -> Cmd -> Cmd Source #
Pipes from the handle to the fd.
pipeHOut :: Fd -> (Async ProcessStatus -> Handle -> IO ()) -> Cmd -> Cmd Source #
Pipes from the fd to the handle.
Arguments
| :: Fd | The writing end |
| -> Fd | The reading end |
| -> Cmd | The writer command |
| -> Cmd | The reader command |
| -> Cmd |
Pipes from the first command to the second command
Arguments
| :: Fd | The reading end |
| -> Fd | The writing end |
| -> Cmd | The reader command |
| -> Cmd | The writer command |
| -> Cmd |
Pipes from the second command to the first command
pipeArgHIn :: (Async ProcessStatus -> Handle -> IO ()) -> Cmd -> Cmd Source #
Pass an argument of the form /proc/self/fd/<n> to the process,
where n is the reader end of a pipe where the writer end is passed
to a Haskell function.
pipeArgHOut :: (Async ProcessStatus -> Handle -> IO ()) -> Cmd -> Cmd Source #
Pass an argument of the form /proc/self/fd/<n> to the process,
where n is the writer end of a pipe where the reader end is passed
to a Haskell function.
captureFdsAsHandles :: [Fd] -> Cmd -> IO (Async ProcessStatus, [Handle]) Source #
Captures the outputs to the specified fds.
waitCmd :: Async ProcessStatus -> IO () Source #
Wait on a process status and raise CmdException if it is a non-zero exit code.