process-extras-0.3.0.1: Process extras

Safe HaskellNone
LanguageHaskell98

System.Process.Common

Synopsis

Documentation

class Monoid b => ProcessOutput a b | b -> a where Source

Methods

pidf :: ProcessHandle -> b Source

outf :: a -> b Source

errf :: a -> b Source

intf :: SomeException -> b Source

codef :: ExitCode -> b Source

readProcessWithExitCode Source

Arguments

:: ListLikeProcessIO a c 
=> FilePath

command to run

-> [String]

any arguments

-> a

standard input

-> IO (ExitCode, a, a)

exitcode, stdout, stderr

Like readProcessWithExitCode, but with generalized input and output type.

readCreateProcessWithExitCode Source

Arguments

:: ListLikeProcessIO a c 
=> CreateProcess

command and arguments to run

-> a

standard input

-> IO (ExitCode, a, a)

exitcode, stdout, stderr

readCreateProcessLazy :: (ProcessOutput a b, ListLikeProcessIO a c) => CreateProcess -> a -> IO b Source

Like readCreateProcess, but the output is read lazily.

readInterleaved :: (ListLikeProcessIO a c, ProcessOutput a b) => [(a -> b, Handle)] -> IO b -> IO b Source

Helper function for readCreateProcessLazy.

readInterleaved' :: forall a b c. (ListLikeProcessIO a c, ProcessOutput a b) => [(a -> b, Handle)] -> IO b -> MVar (Either Handle b) -> IO b Source

writeInput :: ListLikeProcessIO a c => Handle -> a -> IO () Source

Write and flush process input, closing the handle when done. Catch and ignore Resource Vanished exceptions, they just mean the process exited before all of its output was read.

resourceVanished :: (IOError -> IO a) -> IOError -> IO a Source

Wrapper for a process that provides a handler for the ResourceVanished exception. This is frequently an exception we wish to ignore, because many processes will deliberately exit before they have read all of their input.