io-streams-1.2.1.1: Simple, composable, and easy-to-use stream I/O

Safe HaskellNone
LanguageHaskell2010

System.IO.Streams.Process

Description

A module adapting the functions from System.Process to work with io-streams.

Synopsis

Documentation

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

runInteractiveProcess Source

Arguments

:: FilePath

Filename of the executable (see proc for details)

-> [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