Copyright | (c) 2020 Composewell Technologies |
---|---|
License | Apache-2.0 |
Maintainer | streamly@composewell.com |
Stability | experimental |
Portability | GHC |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Synopsis
- data Process
- newProcess :: IO () -> FilePath -> [String] -> Maybe [(String, String)] -> IO Process
- wait :: Process -> IO ProcessStatus
- getStatus :: Process -> IO (Maybe ProcessStatus)
- mkPipe :: Direction -> IO (Fd, Fd, (IO (), IO (), IO ()))
- mkStdioPipes :: Bool -> IO ((Handle, Handle, Maybe Handle, Handle, Handle), IO (), IO (), IO ())
Processes
Thread safe, mutable process handle. Process status is stored in the handle and is modified by the process inspection operations.
:: IO () | Execute after fork, before exec |
-> FilePath | Executable path |
-> [String] | Arguments |
-> Maybe [(String, String)] | Environment |
-> IO Process |
Creates a new process, executes the specified action in the cloned process
and then performs an exec
system call using the provided path, arguments
and environment. The PATH is searched for the specified binary when the
specified path is not absolute?
wait :: Process -> IO ProcessStatus Source #
Wait until the process exits by itself or gets terminated due to a signal.
Returns the ProcessStatus
which includes the termination reason or exit
code.
Thread safe.