| Copyright | (c) The University of Glasgow 2004 |
|---|---|
| License | BSD-style (see the file libraries/base/LICENSE) |
| Maintainer | libraries@haskell.org |
| Stability | experimental |
| Portability | portable |
| Safe Haskell | Trustworthy |
| Language | Haskell2010 |
System.Process.Internals
Description
Note: This module exports internal implementation details that may change anytime. If you want a more stable API, use System.Process instead.
- data ProcessHandle = ProcessHandle !(MVar ProcessHandle__) !Bool
- data ProcessHandle__
- type PHANDLE = CPid
- closePHANDLE :: PHANDLE -> IO ()
- mkProcessHandle :: PHANDLE -> Bool -> IO ProcessHandle
- modifyProcessHandle :: ProcessHandle -> (ProcessHandle__ -> IO (ProcessHandle__, a)) -> IO a
- withProcessHandle :: ProcessHandle -> (ProcessHandle__ -> IO a) -> IO a
- data CreateProcess = CreateProcess {}
- data CmdSpec
- data StdStream
- createProcess_ :: String -> CreateProcess -> IO (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle)
- runGenProcess_ :: String -> CreateProcess -> Maybe CLong -> Maybe CLong -> IO (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle)
- startDelegateControlC :: IO ()
- endDelegateControlC :: ExitCode -> IO ()
- stopDelegateControlC :: IO ()
- pPrPr_disableITimers :: IO ()
- c_execvpe :: CString -> Ptr CString -> Ptr CString -> IO CInt
- ignoreSignal :: CLong
- defaultSignal :: CLong
- withFilePathException :: FilePath -> IO a -> IO a
- withCEnvironment :: [(String, String)] -> (Ptr CString -> IO a) -> IO a
- translate :: String -> String
- fdToHandle :: FD -> IO Handle
Documentation
data ProcessHandle
Constructors
| ProcessHandle !(MVar ProcessHandle__) !Bool |
data ProcessHandle__
A handle to a process, which can be used to wait for termination
of the process using waitForProcess.
None of the process-creation functions in this library wait for
termination: they all return a ProcessHandle which may be used
to wait for the process later.
Constructors
| OpenHandle PHANDLE | |
| ClosedHandle ExitCode |
closePHANDLE :: PHANDLE -> IO ()
mkProcessHandle :: PHANDLE -> Bool -> IO ProcessHandle
modifyProcessHandle :: ProcessHandle -> (ProcessHandle__ -> IO (ProcessHandle__, a)) -> IO a
withProcessHandle :: ProcessHandle -> (ProcessHandle__ -> IO a) -> IO a
data CreateProcess
Constructors
| CreateProcess | |
Fields
| |
data CmdSpec
Constructors
| ShellCommand String | A command line to execute using the shell |
| RawCommand FilePath [String] | The name of an executable with a list of arguments The
|
Instances
| IsString CmdSpec | construct a Since: 1.2.1.0 |
data StdStream
Constructors
| Inherit | Inherit Handle from parent |
| UseHandle Handle | Use the supplied Handle |
| CreatePipe | Create a new pipe. The returned
|
Arguments
| :: String | function name (for error messages) |
| -> CreateProcess | |
| -> IO (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle) |
This function is almost identical to
createProcess. The only differences are:
Handles provided viaUseHandleare not closed automatically.- This function takes an extra
Stringargument to be used in creating error messages.
This function has been available from the System.Process.Internals module for some time, and is part of the System.Process module since version 1.2.1.0.
Since: 1.2.1.0
Arguments
| :: String | function name (for error messages) |
| -> CreateProcess | |
| -> Maybe CLong | handler for SIGINT |
| -> Maybe CLong | handler for SIGQUIT |
| -> IO (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle) |
Deprecated: Please do not use this anymore, use the ordinary createProcess. If you need the SIGINT handling, use delegate_ctlc = True (runGenProcess_ is now just an imperfectly emulated stub that probably duplicates or overrides your own signal handling).
startDelegateControlC :: IO ()
endDelegateControlC :: ExitCode -> IO ()
stopDelegateControlC :: IO ()
pPrPr_disableITimers :: IO () Source
withFilePathException :: FilePath -> IO a -> IO a
fdToHandle :: FD -> IO Handle Source
Turn an existing file descriptor into a Handle. This is used by various external libraries to make Handles.
Makes a binary Handle. This is for historical reasons; it should probably be a text Handle with the default encoding and newline translation instead.