Process +System -package

type ProcessGroupID = CPid
base System.Posix.Types
type ProcessID = CPid
base System.Posix.Types
data ProcessHandle
process System.Process
ProcessInput :: TerminalMode
unix System.Posix.Terminal, unix System.Posix.Terminal.ByteString
ProcessOutput :: TerminalMode
unix System.Posix.Terminal, unix System.Posix.Terminal.ByteString
data ProcessStatus
unix System.Posix.Process.Internals, unix System.Posix.Process.ByteString, unix System.Posix.Process
processStatusChanged :: Signal
unix System.Posix.Signals
ProcessTimes :: ClockTick -> ClockTick -> ClockTick -> ClockTick -> ClockTick -> ProcessTimes
unix System.Posix.Process.ByteString, unix System.Posix.Process
data ProcessTimes
unix System.Posix.Process.ByteString, unix System.Posix.Process
module System.Posix.Process
unix System.Posix.Process
POSIX process support. See also the System.Cmd and System.Process modules in the process package.
module System.Process
process System.Process
Operations for creating and interacting with sub-processes.
continueProcess :: Signal
unix System.Posix.Signals
CreateProcess :: CmdSpec -> Maybe FilePath -> Maybe [(String, String)] -> StdStream -> StdStream -> StdStream -> Bool -> Bool -> CreateProcess
process System.Process
data CreateProcess
process System.Process
createProcess :: CreateProcess -> IO (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle)
process System.Process
This is the most general way to spawn an external process. The process can be a command line to be executed by a shell or a raw command with a list of arguments. The stdin, stdout, and stderr streams of the new process may individually be attached to new pipes, to existing Handles, or just inherited from the parent (the default.) The details of how to create the process are passed in the CreateProcess record. To make it easier to construct a CreateProcess, the functions proc and shell are supplied that fill in the fields with default values which can be overriden as needed. createProcess returns (mb_stdin_hdl, mb_stdout_hdl, mb_stderr_hdl, p), * if std_in == CreatePipe, then mb_stdin_hdl will be Just h, connected to the child process's stdin. * otherwise, mb_stdin_hdl == Nothing Similarly for mb_stdout_hdl and mb_stderr_hdl. For example, to execute a simple ls command: > r <- createProcess (proc "ls" []) To create a pipe from which to read the output of ls: > (_, Just hout, _, _) <- > createProcess (proc "ls" []){ std_out = CreatePipe } To also set the directory in which to run ls: > (_, Just hout, _, _) <- > createProcess (proc "ls" []){ cwd = Just "\home\bob", > std_out = CreatePipe }
createProcessGroup :: ProcessID -> IO ProcessGroupID
unix System.Posix.Process.ByteString, unix System.Posix.Process
createProcessGroup pid calls setpgid to make process pid a new process group leader. This function is currently deprecated, and might be changed to making the current process a new process group leader in future versions.
createProcessGroupFor :: ProcessID -> IO ProcessGroupID
unix System.Posix.Process.ByteString, unix System.Posix.Process
createProcessGroupFor pid calls setpgid to make process pid a new process group leader.
forkProcess :: IO () -> IO ProcessID
unix System.Posix.Process.ByteString, unix System.Posix.Process
forkProcess corresponds to the POSIX fork system call. The IO action passed as an argument is executed in the child process; no other threads will be copied to the child process. On success, forkProcess returns the child's ProcessID to the parent process; in case of an error, an exception is thrown. forkProcess comes with a giant warning: since any other running threads are not copied into the child process, it's easy to go wrong: e.g. by accessing some shared resource that was held by another thread in the parent.
getAnyProcessStatus :: Bool -> Bool -> IO (Maybe (ProcessID, ProcessStatus))
unix System.Posix.Process.ByteString, unix System.Posix.Process
getAnyProcessStatus blk stopped calls waitpid, returning Just (pid, tc), the ProcessID and ProcessStatus for any child process if one is available, Nothing otherwise. If blk is False, then WNOHANG is set in the options for waitpid, otherwise not. If stopped is True, then WUNTRACED is set in the options for waitpid, otherwise not.
getGroupProcessStatus :: Bool -> Bool -> ProcessGroupID -> IO (Maybe (ProcessID, ProcessStatus))
unix System.Posix.Process.ByteString, unix System.Posix.Process
getGroupProcessStatus blk stopped pgid calls waitpid, returning Just (pid, tc), the ProcessID and ProcessStatus for any process in group pgid if one is available, Nothing otherwise. If blk is False, then WNOHANG is set in the options for waitpid, otherwise not. If stopped is True, then WUNTRACED is set in the options for waitpid, otherwise not.

Show more results