| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
newtype CommunicationHandle Source
Gets a GHC Handle File description from the given OS Handle or POSIX fd.
A CommunicationHandle is an abstraction over operating-system specific internal representation of a Handle, which can be communicated through a command-line interface.
In a typical use case, the parent process creates a pipe, using e.g. createWeReadTheyWritePipe or createTheyReadWeWritePipe.
Handle, which can be read from/written to by the parent process.CommunicationHandle, which can be inherited by a child process. A reference to the handle can be serialised (using the Show instance), and passed to the child process. It is recommended to close the parent's reference to the CommunicationHandle using closeCommunicationHandle after it has been inherited by the child process.CommunicationHandle (using the Read instance), and then use openCommunicationHandleWrite or openCommunicationHandleRead in order to retrieve a Handle which it can write to/read from.readCreateProcessWithExitCodeCommunicationHandle provides a high-level API to this functionality. See there for example code.
Since: process-1.6.20.0
| CommunicationHandle Fd |
closeCommunicationHandle :: CommunicationHandle -> IO () Source
Close a CommunicationHandle.
Use this to close the CommunicationHandle in the parent process after the CommunicationHandle has been inherited by the child process.
Since: process-1.6.20.0
useCommunicationHandle :: Bool -> CommunicationHandle -> IO Handle Source
Internal function used to define openCommunicationHandleRead and openCommunicationHandleWrite.
createCommunicationPipe Source
| :: (forall a. (a, a) -> (a, a)) |
|
| -> Bool | whether to pass a handle supporting asynchronous I/O to the child process (this flag only has an effect on Windows and when using WinIO) |
| -> IO (Handle, CommunicationHandle) |
Internal helper function used to define createWeReadTheyWritePipe and createTheyReadWeWritePipe while reducing code duplication.
The returned Handle does not have any finalizers attached to it; use hClose to close it.
© The University of Glasgow and others
Licensed under a BSD-style license (see top of the page).
https://downloads.haskell.org/~ghc/9.12.1/docs/libraries/process-1.6.25.0-3038/System-Process-CommunicationHandle-Internal.html