Process

expect abstract class Process
actual abstract class Process
actual typealias Process = java.lang.Process
actual abstract class Process
actual abstract class Process

Constructors

Link copied to clipboard
constructor()
constructor()
constructor()

Properties

Link copied to clipboard
abstract val processHandle: <Error class: unknown class>?
Link copied to clipboard
abstract val processId: <Error class: unknown class>
Link copied to clipboard
abstract val processIdentifier: Int

Functions

Link copied to clipboard
expect abstract fun destroy()
actual abstract fun destroy()
actual abstract fun destroy()
actual abstract fun destroy()
Link copied to clipboard
suspend fun Process.destroyAndAwaitExit(gracePeriodMillis: Long, killTimeoutMillis: Long): Boolean

Terminates the process, then waits until it has actually gone.

Link copied to clipboard
expect fun Process.exitCodeOrNull(): Int?

Reports the exit status of a process that has already terminated, or null if it is still running (or the platform cannot tell).

actual fun Process.exitCodeOrNull(): Int?
actual fun Process.exitCodeOrNull(): Int?

Reads the exit status, or null while the process is still running.

actual fun Process.exitCodeOrNull(): Int?

Reads the exit status via GetExitCodeProcess, the same call Process.isAlive uses — null while it still reports STILL_ACTIVE.

actual fun Process.exitCodeOrNull(): Int?

Not available on this target: liveness here is kill(pid, 0), which says whether the process exists but never carries its exit status, and nothing reaps the child to collect one.

Link copied to clipboard
expect fun isAlive(): Boolean
actual fun isAlive(): Boolean
actual fun isAlive(): Boolean
actual fun isAlive(): Boolean
Link copied to clipboard
expect fun Process.killTree()

Forcibly kills the process and, where the platform supports it, its whole tree.

actual fun Process.killTree()
actual fun Process.killTree()

Kills this process and every descendant.

actual fun Process.killTree()
actual fun Process.killTree()

Kills this process with SIGKILL.

Link copied to clipboard
expect fun pid(): Long
actual fun pid(): Long
actual fun pid(): Long
actual fun pid(): Long
Link copied to clipboard
expect suspend fun Process.readStderrSnapshot(maxBytes: Int = 64 * 1024, timeoutMillis: Long = 250): String?

Reads whatever is currently buffered on the process's stderr, or null if unavailable.

actual suspend fun Process.readStderrSnapshot(maxBytes: Int, timeoutMillis: Long): String?
actual suspend fun Process.readStderrSnapshot(maxBytes: Int, timeoutMillis: Long): String?

Reads whatever is currently buffered on the process's stderr, bounded in both size and time.

actual suspend fun Process.readStderrSnapshot(maxBytes: Int, timeoutMillis: Long): String?

Not available on this target: startProcess here calls CreateProcessW without redirecting the child's standard streams, so there is no pipe to read from.

actual suspend fun Process.readStderrSnapshot(maxBytes: Int, timeoutMillis: Long): String?