Skip to main content

Zymba Documentation

IO.Process

Text
object @IO.Process(@Base) {
construct(string $command, string $path, ?object $environment) {}
close(): int {}
exit() {}
getCommand(): string {}
getExitCode(): int {}
getProcessID(): int {}
isRunning(): bool {}
selectErrorStream(): object {}
selectInputStream(): object {}
selectOutputStream(): object {}
terminate(int $signal): bool {}
toString(): string {}
}

IO process prototype.

Prototype

Base

Methods

Opens a process by executing a specific command.

CODE
$this.construct(string $command, string $path, ?object $environment): void
Parameters
NameTypeValueDefault
commandstring""
pathstring""
environment?objectinherited

Closes this process, frees its associated resources and returns its exit code.

CODE
$this.close(): int
Returns
TypeValue
int

Closes this process and frees its associated resources for the purpose of contextualization.

CODE
$this.exit(): void

Gets the command that created this process.

CODE
$this.getCommand(): string
Returns
TypeValue
string

Gets the exit code returned by this process.

CODE
$this.getExitCode(): int
Returns
TypeValue
int

Gets the process ID.

CODE
$this.getProcessID(): int
Returns
TypeValue
int

Determines whether this process is running.

CODE
$this.isRunning(): bool
Returns
TypeValue
bool

Selects the error stream of this process.

CODE
$this.selectErrorStream(): @IO.Stream
Returns
TypeValue
@IO.Stream

Selects the input stream of this process.

CODE
$this.selectInputStream(): @IO.Stream
Returns
TypeValue
@IO.Stream

Selects the output stream of this process.

CODE
$this.selectOutputStream(): @IO.Stream
Returns
TypeValue
@IO.Stream

Terminates this process without blocking by signaling a termination request.

CODE
$this.terminate(int $signal): bool
Parameters
NameTypeValueDefault
signalint15
Returns
TypeValue
bool

Converts this process to a string by returning the command that created it.

CODE
$this.toString(): string
Returns
TypeValue
string