procex-0.3.0: Ergonomic process launching with extreme flexibility and speed
Safe HaskellSafe-Inferred
LanguageHaskell2010

Procex.Process

Description

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

Synopsis

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.

run :: Cmd -> IO () Source #

Runs a command synchronously. See also run'. CmdException will be thrown if the command fails.

pipeArgIn Source #

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.

pipeArgOut Source #

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.

pipeIn Source #

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

pipeOut Source #

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.