RedirectedProcess Class

Namespace: Improbable.Gdk.ToolsSource

Runs a windowless process.


Static Methods

Command Source
RedirectedProcess Command(string command)

Creates the redirected process for the command.

Parameters
  • string command : The filename to run.

Spatial Source
RedirectedProcess Spatial(params string[] args)

Parameters
  • params string[] args :


Methods

WithArgs Source
RedirectedProcess WithArgs(params string[] arguments)

Adds arguments to process command call.

Parameters
  • params string[] arguments : Parameters that will be passed to the command.

InDirectory Source
RedirectedProcess InDirectory(string directory)

Sets which directory run the process in.

Parameters
  • string directory : Working directory of the process.

AddOutputProcessing Source
RedirectedProcess AddOutputProcessing(Action<string> outputProcessor)

Adds custom processing for regular output of process.

Parameters
  • Action<string> outputProcessor : Processing action for regular output.

Notes:
  • The outputProcessor callback will be ran on a different thread to the one which registered it.

AddErrorProcessing Source
RedirectedProcess AddErrorProcessing(Action<string> errorProcessor)

Adds custom processing for error output of process.

Parameters
  • Action<string> errorProcessor : Processing action for error output.

Notes:
  • The errorProcessor callback will be ran on a different thread to the one which registered it.

RedirectOutputOptions Source
RedirectedProcess RedirectOutputOptions(OutputRedirectBehaviour redirectBehaviour)

Adds custom processing for error output of process.

Parameters

Run Source
RedirectedProcessResult Run()

Runs the redirected process and waits for it to return.

RunAsync Source
Task<RedirectedProcessResult> RunAsync(CancellationToken token = default)

Runs the redirected process and returns a task which can be waited on.

Returns:
A task which would return the exit code and output.

Parameters
  • CancellationToken token : A cancellation token which can be used for cancelling the underlying process. Default is CancellationToken.None.

Updated about a year ago


RedirectedProcess Class


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.