procex-0.3.3: Ergonomic process launching with extreme flexibility and speed

Procex.Process

Description

This module wraps over the API in Procex.Core in a user-friendly way.

Synopsis

# Documentation

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

Instances details
 Source # Instance detailsDefined in Procex.Process Methods Source # Instance detailsDefined in Procex.Process MethodsshowList :: [CmdException] -> ShowS #

run :: Cmd -> IO () Source #

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.

Wait on a process status and raise CmdException if it is a non-zero exit code.