Package net.rubygrapefruit.platform
Interface Process
- All Superinterfaces:
NativeIntegration
- All Known Implementing Classes:
DefaultProcess
,WrapperProcess
Functions to query and modify a process' state.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
detach()
Detaches this process from the parent to ignore ctrl-c.getEnvironmentVariable
(String name) Get the value of an environment variable.int
Returns the process identifier.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
Returns the process identifier.- Throws:
NativeException
- On failure.
-
detach
Detaches this process from the parent to ignore ctrl-c.- Throws:
NativeException
- On failure.
-
getWorkingDirectory
Returns the process' current working directory.- Throws:
NativeException
- On failure.
-
setWorkingDirectory
Sets the process' working directory.- Throws:
NativeException
- On failure.
-
getEnvironmentVariable
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
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.
-