Process module:System -package:unix -is:module -package:Win32 -package:hsyslog-udp package:typed-process

A running process. The three type parameters provide the type of the standard input, standard output, and standard error streams. To interact with a Process use the functions from the section Interact with a process.
An abstract configuration for a process, which can then be launched into an actual running Process. Takes three type parameters, providing the types of standard input, standard output, and standard error, respectively. There are three ways to construct a value of this type:
  • With the proc smart constructor, which takes a command name and a list of arguments.
  • With the shell smart constructor, which takes a shell string
  • With the IsString instance via OverloadedStrings. If you provide it a string with no spaces (e.g., "date"), it will treat it as a raw command with no arguments (e.g., proc "date" []). If it has spaces, it will use shell.
In all cases, the default for all three streams is to inherit the streams from the parent process. For other settings, see the setters below for default values. Once you have a ProcessConfig you can launch a process from it using the functions in the section Launch a process.
Run a process, capture its standard output and error as a ByteString, wait for it to complete, and then return its exit code, output, and error. Note that any previously used setStdout or setStderr will be overridden.
Same as readProcess, but interleaves stderr with stdout. Motivation: Use this function if you need stdout interleaved with stderr output (e.g. from an HTTP server) in order to debug failures.
Same as readProcessInterleaved, but instead of returning the ExitCode, checks it with checkExitCode. Exceptions thrown by this function will include stdout.
Same as readProcess, but only read the stderr of the process. Original settings for stdout remain.
Same as readProcessStderr, but instead of returning the ExitCode, checks it with checkExitCode. Exceptions thrown by this function will include stderr.
Same as readProcess, but only read the stdout of the process. Original settings for stderr remain.
Same as readProcessStdout, but instead of returning the ExitCode, checks it with checkExitCode. Exceptions thrown by this function will include stdout.
Same as readProcess, but instead of returning the ExitCode, checks it with checkExitCode. Exceptions thrown by this function will include stdout and stderr.
Run the given process, wait for it to exit, and returns its ExitCode.
Same as runProcess, but instead of returning the ExitCode, checks it with checkExitCode.
Launch a process based on the given ProcessConfig. You should ensure that you call stopProcess on the result. It's usually better to use one of the functions in this module which ensures stopProcess is called, such as withProcessWait.
Close a process and release any resources acquired. This will ensure terminateProcess is called, wait for the process to actually exit, and then close out resources allocated for the streams. In the event of any cleanup exceptions being thrown this will throw an exception.
Take ProcessHandle out of the Process. This method is needed in cases one need to use low level functions from the process package. Use cases for this method are:
  1. Send a special signal to the process.
  2. Terminate the process group instead of terminating single process.
  3. Use platform specific API on the underlying process.
This method is considered unsafe because the actions it performs on the underlying process may overlap with the functionality that typed-process provides. For example the user should not call waitForProcess on the process handle as either waitForProcess or stopProcess will lock. Additionally, even if process was terminated by the terminateProcess or by sending signal, stopProcess should be called either way in order to cleanup resources allocated by the typed-process.
Deprecated: Please consider using withProcessWait, or instead use withProcessTerm
Uses the bracket pattern to call startProcess and ensures that stopProcess is called. This function is usually not what you want. You're likely better off using withProcessWait. See https://github.com/fpco/typed-process/issues/25.
Same as withProcessTerm, but also calls checkExitCode To interact with a Process use the functions from the section Interact with a process.
Uses the bracket pattern to call startProcess. Unlike withProcessTerm, this function will wait for the child process to exit, and only kill it with stopProcess in the event that the inner function throws an exception. To interact with a Process use the functions from the section Interact with a process.
Same as withProcessWait, but also calls checkExitCode
Deprecated: Please consider using withProcessWait_, or instead use withProcessTerm_
Internal helper