package spotlib
Module Xunix.CommandDeprecatedSource
Command invocation
Typical usage is:
starter |> scanner , for example shell "ls /" |> print
or
starter |> scanner |> result_checker , for example shell "ls /" |> get_stdout |> must_exist_with ~name:"ls /" 0
Starter
Starters invoke processes and returns a value of 'st t. You do not need to care about 'st: it is determined by a output scanner.
Same as shell_command but it takes the command and arguments as a list of string, then directly executed by Unix.execvp.
Output scanner
Output scanner takes the result of a starter and scans its stdout+stderr output. After all the stdout+stderr outputs are sent to the scanner, it returns the final result of the scan and the process status
val fold :
'st t ->
init:'st ->
f:('st -> ([ `Out | `Err ] * [ `Read of string | `EOF ]) -> 'st) ->
'st resultGeneric scanner
val iter :
unit t ->
f:(([ `Out | `Err ] * [ `Read of string | `EOF ]) -> unit) ->
unit resultIteration over stdout+stderr outputs
Output to stdout and stderr of the command are printed to stdout and stderr resp.ly.
Gather stdout lines. Stderr outputs are printed to stderr.
Result tools