---
title: "IO.Process"
description: "IO process prototype."
canonical_url: "https://www.zeyos.com/zymba/ref/io/io-process"
markdown_url: "https://www.zeyos.com/ai/guide/zymba/ref/io/io-process.md"
section: "zymba-reference"
authority: "reference"
language: "en"
source_repository: "https://cloud.zeyos.com/__doc/zymbaref.json"
source_sha256: "05a361c6ddc32e74f4a6dc16fd06f218210ff1b7ce57f26ca1994bfffc407915"
---

# IO.Process

## IO.Process

```
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


### `$this.construct()`


Opens a process by executing a specific command.

```code
$this.construct(string $command, string $path, ?object $environment): void
```

##### Parameters

| Name | Type | Value | Default |
| --- | --- | --- | --- |
| command | `string`  |  | "" |
| path | `string`  |  | "" |
| environment | `?object`  |  | inherited |




### `$this.close()`


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

```code
$this.close(): int
```

##### Returns

| Type | Value |
| --- | ---  |
| `int` |  |




### `$this.exit()`


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

```code
$this.exit(): void
```




### `$this.getCommand()`


Gets the command that created this process.

```code
$this.getCommand(): string
```

##### Returns

| Type | Value |
| --- | ---  |
| `string` |  |




### `$this.getExitCode()`


Gets the exit code returned by this process.

```code
$this.getExitCode(): int
```

##### Returns

| Type | Value |
| --- | ---  |
| `int` |  |




### `$this.getProcessID()`


Gets the process ID.

```code
$this.getProcessID(): int
```

##### Returns

| Type | Value |
| --- | ---  |
| `int` |  |




### `$this.isRunning()`


Determines whether this process is running.

```code
$this.isRunning(): bool
```

##### Returns

| Type | Value |
| --- | ---  |
| `bool` |  |




### `$this.selectErrorStream()`


Selects the error stream of this process.

```code
$this.selectErrorStream(): @IO.Stream
```

##### Returns

| Type | Value |
| --- | ---  |
| `@IO.Stream` |  |




### `$this.selectInputStream()`


Selects the input stream of this process.

```code
$this.selectInputStream(): @IO.Stream
```

##### Returns

| Type | Value |
| --- | ---  |
| `@IO.Stream` |  |




### `$this.selectOutputStream()`


Selects the output stream of this process.

```code
$this.selectOutputStream(): @IO.Stream
```

##### Returns

| Type | Value |
| --- | ---  |
| `@IO.Stream` |  |




### `$this.terminate()`


Terminates this process without blocking by signaling a termination request.

```code
$this.terminate(int $signal): bool
```

##### Parameters

| Name | Type | Value | Default |
| --- | --- | --- | --- |
| signal | `int`  |  | 15 |

##### Returns

| Type | Value |
| --- | ---  |
| `bool` |  |




### `$this.toString()`


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

```code
$this.toString(): string
```

##### Returns

| Type | Value |
| --- | ---  |
| `string` |  |
