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.
Methods
Waits for the process to finish its work and exit.
Returns the exit code of the process when it has finished the execution.
Destroys the process.
Provides a channel (to write into), which is made available as the 'standard input' for the process.
Provides a channel (to read from), which is made available as the 'standard output' of the process.
Provides a channel (to read from), which is made available as the 'standard error' of the process.
Pipes the standard output of the current process to the standard input of the given process.
Waits for the process to finish its work and exit.
int|error exitCode = process.waitForExit();
-
Return Type
(int | Error) Returns the exit code for the process or else an
Error
if a failure occurs
Returns the exit code of the process when it has finished the execution.
Error if the process has not exited yet.
int|error exitCode = process.exitCode();
-
Return Type
(int | Error) Returns the exit code of the process or else an
Error
if the process hasn't exited yet
Provides a channel (to write into), which is made available as the 'standard input' for the process.
io:WritableByteChannel output = process.stdin();
-
Return Type
(WritableByteChannel) The
io:WritableByteChannel
, which represents the process's 'standard input'
Provides a channel (to read from), which is made available as the 'standard output' of the process.
io:ReadableByteChannel input = process.stdout();
-
Return Type
(ReadableByteChannel) The
io:ReadableByteChannel
, which represents the process's 'standard output'
Provides a channel (to read from), which is made available as the 'standard error' of the process.
io:ReadableByteChannel input = process.stderr();
-
Return Type
(ReadableByteChannel) The
io:ReadableByteChannel
, which represents the process's 'standard error'