Package-level declarations

Types

Link copied to clipboard
data class CommunicateResult(val exitCode: Int, val output: String, val errors: String)

Result tuple of Process.communicate().

Link copied to clipboard
expect object Environment : Map<String, String>

The current process environment.

actual object Environment : Map<String, String>
Link copied to clipboard

A mutable copy of the current environment.

Link copied to clipboard

Builder for the exec method.

Link copied to clipboard
expect class Process(args: ProcessArguments)

A child process.

actual class Process(val args: ProcessArguments)
actual class Process(val args: ProcessArguments)
actual class Process(val args: ProcessArguments)
actual class Process(val args: ProcessArguments)
Link copied to clipboard

Mutable builder for process arguments and environment.

Link copied to clipboard
class ProcessArguments(arguments: Iterable<String>, val workingDirectory: String? = null, environment: Map<String, String>? = null, val stdin: Redirect = Redirect.Pipe, val stdout: Redirect = Redirect.Pipe, val stderr: Redirect = Redirect.Pipe)

Immutable process launch arguments.

Link copied to clipboard
class ProcessConfigException(message: String? = null, cause: Throwable? = null) : ProcessException

Indicates a problem with the process setup.

Link copied to clipboard
open class ProcessException(message: String? = null, cause: Throwable? = null) : Exception

General subprocess exception.

Link copied to clipboard

Indicates a process that didn't exit cleanly.

Link copied to clipboard
sealed class Redirect

Subprocess pipe redirection settings.

Properties

Link copied to clipboard

Functions

Link copied to clipboard
suspend fun Process.communicate(input: String = "", timeout: Duration? = null, killTimeout: Duration? = null): CommunicateResult

Communicate with the process and wait for its termination.

Link copied to clipboard
suspend fun exec(builder: ExecArgumentsBuilder.() -> Unit): CommunicateResult

Launch a process, communicate with it and check the result.

Link copied to clipboard

Locate the named executable on the system PATH.

Link copied to clipboard
inline fun Process(builder: ProcessArgumentBuilder.() -> Unit): Process

Launch process using builder.

Link copied to clipboard

Create ProcessArguments using builder.