Package net.rubygrapefruit.platform

# Interface Process

All Superinterfaces:
  `NativeIntegration`

All Known Implementing Classes:
  `DefaultProcess`, `WrapperProcess`

public interface Process extends NativeIntegration
Functions to query and modify a process' state.

## Method Summary

Modifier and Type
Method
Description
`void`
`detach()`
Detaches this process from the parent to ignore ctrl-c.
`String`
`getEnvironmentVariable(String name)`
Get the value of an environment variable.
`int`
`getProcessId()`
Returns the process identifier.
`File`
`getWorkingDirectory()`
Returns the process' current working directory.
`void`
`setEnvironmentVariable(String name, String value)`
Sets the value of an environment variable.
`void`
`setWorkingDirectory(File directory)`
Sets the process' working directory.

## Method Details

### getProcessId

int getProcessId() throws NativeException
Returns the process identifier.

Throws:
  `NativeException` - On failure.

### detach

void detach() throws NativeException
Detaches this process from the parent to ignore ctrl-c.

Throws:
  `NativeException` - On failure.

### getWorkingDirectory

File getWorkingDirectory() throws NativeException
Returns the process' current working directory.

Throws:
  `NativeException` - On failure.

### setWorkingDirectory

void setWorkingDirectory(File directory) throws NativeException
Sets the process' working directory.

Throws:
  `NativeException` - On failure.

### getEnvironmentVariable

String getEnvironmentVariable(String name) throws NativeException
Get the value of an environment variable.

Returns:
  The value or null if no such environment variable. Also returns null for an environment variable whose value is an empty string.
Throws:
  `NativeException` - On failure.

### setEnvironmentVariable

void setEnvironmentVariable(String name, String value) throws NativeException
Sets the value of an environment variable.

Parameters:
  `value` - the new value. Use null or an empty string to remove the environment variable. Note that on some platforms it is not possible to remove the environment variable safely. On such platforms, the value is set to an empty string instead.
Throws:
  `NativeException` - On failure.