Object - system : Process

This object contains information on a process being created from Ballerina. This is returned from the exec function in the system module.

waitForExit

()

returns int | Error

Waits for the process to finish it's work and exit.

  • Return Type

    (int | Error)
  • Returns the exit code for the process, or an Error if a failure occurs

exitCode

()

returns int | Error

Returns the exit code of the process when it has finished the execution. Error if the process has not exited yet.

  • Return Type

    (int | Error)
  • Returns the exit code of the process, or an Error if the process hasn't exited yet

destroy

Destroys the process.

stdin

()

returns WritableByteChannel

Provides a channel (to write into), which is made available as the 'standard input' for the process.

  • Return Type

    (WritableByteChannel)
  • The io:WritableByteChannel which represents the process's 'standard input'

stdout

()

returns ReadableByteChannel

Provides a channel (to read from), which is made available as the 'standard output' of the process.

  • Return Type

    (ReadableByteChannel)
  • The io:ReadableByteChannel which represents the process's 'standard output'

stderr

()

returns ReadableByteChannel

Provides a channel (to read from), which is made available as the 'standard error' of the process.

  • Return Type

    (ReadableByteChannel)
  • The io:ReadableByteChannel which represents the process's 'standard error'

pipe

(Process process)

returns Process

Pipes the standard output of the current process to the standard input of the given process.

Parameters

  • process Process
  • The process to pipe the data to

  • Return Type

    (Process)
  • The process that is passed in, which is used to help chain pipe operations