Safe Haskell | None |
---|
A module adapting the functions from System.Process to work with
io-streams
.
- module System.Process
- runInteractiveCommand :: String -> IO (OutputStream ByteString, InputStream ByteString, InputStream ByteString, ProcessHandle)
- runInteractiveProcess :: FilePath -> [String] -> Maybe FilePath -> Maybe [(String, String)] -> IO (OutputStream ByteString, InputStream ByteString, InputStream ByteString, ProcessHandle)
Documentation
module System.Process
runInteractiveCommand :: String -> IO (OutputStream ByteString, InputStream ByteString, InputStream ByteString, ProcessHandle)Source
Runs a command using the shell, and returns streams that may be used to communicate with the process via its stdin, stdout, and stderr respectively.
The streams returned by this command are guarded by locks and are therefore safe to use in multithreaded code.
Since: 1.0.2.0
:: FilePath | Filename of the executable (see |
-> [String] | Arguments to pass to the executable |
-> Maybe FilePath | Optional path to the working directory |
-> Maybe [(String, String)] | Optional environment (otherwise inherit) |
-> IO (OutputStream ByteString, InputStream ByteString, InputStream ByteString, ProcessHandle) |
Runs a raw command, and returns streams that may be used to communicate
with the process via its stdin
, stdout
and stderr
respectively.
For example, to start a process and feed a string to its stdin:
(inp,out,err,pid) <- runInteractiveProcess "..." forkIO (Streams.write (Just str) inp)
The streams returned by this command are guarded by locks and are therefore safe to use in multithreaded code.
Since: 1.0.2.0