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

Procex.Core

Description

Defines Cmd, the core API of Procex.

Synopsis

Documentation

data Cmd Source #

A command. You can execute this with run' or run.

Instances

Instances details
QuickCmd Cmd Source # 
Instance details

Defined in Procex.Quick

Methods

quickCmd :: Cmd -> Cmd Source #

QuickCmdArg [Cmd -> Cmd] Source # 
Instance details

Defined in Procex.Quick

Methods

quickCmdArg :: [Cmd -> Cmd] -> Cmd -> Cmd Source #

QuickCmdArg (Cmd -> Cmd) Source # 
Instance details

Defined in Procex.Quick

Methods

quickCmdArg :: (Cmd -> Cmd) -> Cmd -> Cmd Source #

makeCmd' :: ByteString -> Cmd Source #

Make a Cmd from the path to an executable. Does not take PATH into account. See makeCmd for a version that provides some sensible defaults, like forwarding stdin, stdout, stderr.

passArg :: ByteString -> Cmd -> Cmd Source #

Pass an argument to the command.

unIOCmd :: IO Cmd -> Cmd Source #

Embeds the IO action inside the command, such that the IO action is executed when the command is executed.

postCmd :: (Either SomeException (Async ProcessStatus) -> IO ()) -> Cmd -> Cmd Source #

Executes some code after launching the process. If launching the process fails, it will be provided with the exception it failed with.

run' :: Cmd -> IO (Async ProcessStatus) Source #

Runs the specified command asynchronously and returns the process status.

runReplace :: Cmd -> IO () Source #

Runs the specified commands and replaces the current process with it. This will not return unless an error occurs while executing the process.

passFd Source #

Arguments

:: (Fd, Fd)

(new, old)

-> Cmd 
-> Cmd 

Bind a fd in the new process to a fd available now. If you try to bind an fd already bound, it will simply replace the older binding.

passArgFd :: Fd -> Cmd -> Cmd Source #

Pass an argument of the form /proc/self/fd/<n> to the process, where n is an fd which is a duplicate of the fd provided here.

passNoFd Source #

Arguments

:: Fd

new

-> Cmd 
-> Cmd 

Don't open a fd in the new process if it was going to be opened by passFd. Does not affect fds opened by passArgFd.