ProcessConfig CLASS

The configuration set to use when spawning a process.

The configuration object must be fully set before it's used to start a process. Once the process is started any new changes to this object won't affect the behavior of the running process.

Parent Class

All Members


TypeNameSignature
methodaddEnvArgpublic void addEnvArg(string, string)
methodgetEnvArgspublic Map getEnvArgs()
methodgetErrorStreampublic Stream getErrorStream()
methodgetInputStreampublic Stream getInputStream()
methodgetOutputStreampublic Stream getOutputStream()
methodgetWorkingDirpublic String getWorkingDir()
methodisInheritedIOpublic bool isInheritedIO()
methodsetErrorStreampublic void setErrorStream(System.IO.Stream)
methodsetInheritedIOpublic void setInheritedIO(bool)
methodsetInputStreampublic void setInputStream(System.IO.Stream)
methodsetOutputStreampublic void setOutputStream(System.IO.Stream)
methodsetWorkingDirpublic void setWorkingDir(string)

Methods


public void addEnvArg(string key, string value)

Add an environment variable to the process.

Parameters

  • key The variable's name.
  • value The variable's value.

public Map getEnvArgs()

Get a map which contains all environment variables, with their names as the key.

Returns

  • The map keyed by environment variable name.

public Stream getErrorStream()

Get the output stream which was set by setErrorStream().

Returns

  • Null if not set.

public Stream getInputStream()

Get the input stream which was set by setInputStream().

Returns

  • Null if not set.

public Stream getOutputStream()

Get the output stream which was set by setOutputStream().

Returns

  • Null if not set.

public String getWorkingDir()

Get working directory of the process.

Returns

  • The working directory for the process. Will be null if never set.

public bool isInheritedIO()

Get if the process is inheriting the I/O channels from the parent process.

Returns

  • false if not inheriting.

public void setErrorStream(Stream stream)

Set an output stream to be used as the standard error from within the process.

Setting this value will overwrite the inherited standard error stream by setting inherited IO.

Parameters

  • stream A stream to take error output out of the process. The stream must be writable.

public void setInheritedIO(bool shouldInherit)

Set if the process will inherit the I/O channels from the parent process.

If inheriting, the process simply directs its standard I/O to the corresponding channels used by the parent process. However, this behavior can be overwritten by explicitly setting a stream to a particular channel, such as setInputStream.

If intending to redirect I/O from the current process, i.e. programmatically write to the process's input and read from the output, must not set this to true.

Parameters

  • shouldInherit if true, the subprocess will inherit the I/O channels from the parent process.

public void setInputStream(Stream stream)

Set an input stream to be used as the standard input from within the process.

Setting this value will overwrite the inherited standard input stream by setting inherited IO.

Parameters

  • stream A stream to send input to the process. The stream must be readable.

public void setOutputStream(Stream stream)

Set an output stream to be used as the standard output from within the process.

Setting this value will overwrite the inherited standard output stream by setting inherited IO.

Parameters

  • stream A stream to take output out of the process. The stream must be writable.

public void setWorkingDir(string dir)

Set working directory of the process. If not set, the process will use default working directory, which is determined by the underlying OS. The working directory is used as the base directory for file system operations using a relative path.

Parameters

  • dir The working directory for the process.