ports-0.4.3.1: The Haskell Ports LibrarySource codeContentsIndex
Control.Concurrent.Processes
Synopsis
type Proc = String -> Port Char -> Port Char -> IO ProcId
data ProcId
toProc :: (String -> String) -> Proc
proc :: FilePath -> [String] -> Proc
procGrp :: FilePath -> [String] -> Proc
(>|) :: Proc -> Proc -> Proc
procStatus :: ProcId -> ExitCode
procKill :: Signal -> ProcId -> IO ()
procGrpKill :: Signal -> ProcId -> IO ()
Documentation
type Proc = String -> Port Char -> Port Char -> IO ProcIdSource
data ProcId Source
toProc :: (String -> String) -> ProcSource
proc :: FilePath -> [String] -> ProcSource

Execute a sub-process asynchronously.

  • The sub-process reads stdin from a lazy list and writes stdout and stderr to a port. These two ports are closed when the stdout and stderr streams are closed.
  • The executable is searched for in the current PATH.
procGrp :: FilePath -> [String] -> ProcSource

Execute a sub-process asynchronously in it's own process group.

  • The sub-process reads stdin from a lazy list and writes stdout and stderr to a port. These two ports are closed when the stdout and stderr streams are closed.
  • The executable is searched for in the current PATH.
  • The process group id is the same as the new process' process id.
(>|) :: Proc -> Proc -> ProcSource
procStatus :: ProcId -> ExitCodeSource

Process operators ------------------

Returns the exit status of the given process (group).

  • Blocks until the value is available.
  • In case of a NoProcId, the availability of the unit argument implements a synchronisation point.
  • In case of a process group, the status is ExitSuccess iff the exit status of all processes is ExitSuccess; otherwise, it is the failure status of any of the failed processes (it is, of course, always deterministically the same, which is picked).
procKill :: Signal -> ProcId -> IO ()Source
Signal a process.
procGrpKill :: Signal -> ProcId -> IO ()Source
Signal a process group.
Produced by Haddock version 2.6.0