SubprocessLauncher

open class SubprocessLauncher(pointer: <Error class: unknown class><<Error class: unknown class>>)

This class contains a set of options for launching child processes, such as where its standard input and output will be directed, the argument list, the environment, and more.

While the #GSubprocess class has high level functions covering popular cases, use of this class allows access to more advanced options. It can also be used to launch multiple subprocesses with a similar configuration.

Skipped during bindings generation

  • method flags: Property has no getter nor setter

Since

2.40

Constructors

Link copied to clipboard
constructor(flags: SubprocessFlags)

Creates a new #GSubprocessLauncher.

constructor(pointer: <Error class: unknown class><<Error class: unknown class>>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val gioSubprocessLauncherPointer: <Error class: unknown class><<Error class: unknown class>>

Functions

Link copied to clipboard
open fun close()

Closes all the file descriptors previously passed to the object with g_subprocess_launcher_take_fd(), g_subprocess_launcher_take_stderr_fd(), etc.

Link copied to clipboard
open fun getenv(variable: String): String?

Returns the value of the environment variable @variable in the environment of processes launched from this launcher.

Link copied to clipboard
open fun setCwd(cwd: String)

Sets the current working directory that processes will be launched with.

Link copied to clipboard
open fun setenv(variable: String, value: String, overwrite: Boolean)

Sets the environment variable @variable in the environment of processes launched from this launcher.

Link copied to clipboard
open fun setEnviron(env: List<String>)

Replace the entire environment of processes launched from this launcher with the given 'environ' variable.

Link copied to clipboard
open fun setFlags(flags: SubprocessFlags)

Sets the flags on the launcher.

Link copied to clipboard
open fun setStderrFilePath(path: String? = null)

Sets the file path to use as the stderr for spawned processes.

Link copied to clipboard
open fun setStdinFilePath(path: String)

Sets the file path to use as the stdin for spawned processes.

Link copied to clipboard
open fun setStdoutFilePath(path: String? = null)

Sets the file path to use as the stdout for spawned processes.

Link copied to clipboard
open fun spawnv(argv: List<String>): <Error class: unknown class><Subprocess>

Creates a #GSubprocess given a provided array of arguments.

Link copied to clipboard
open fun takeFd(sourceFd: Int, targetFd: Int)

Transfer an arbitrary file descriptor from parent process to the child. This function takes ownership of the @source_fd; it will be closed in the parent when @self is freed.

Link copied to clipboard
open fun takeStderrFd(fd: Int)

Sets the file descriptor to use as the stderr for spawned processes.

Link copied to clipboard
open fun takeStdinFd(fd: Int)

Sets the file descriptor to use as the stdin for spawned processes.

Link copied to clipboard
open fun takeStdoutFd(fd: Int)

Sets the file descriptor to use as the stdout for spawned processes.

Link copied to clipboard
open fun unsetenv(variable: String)

Removes the environment variable @variable from the environment of processes launched from this launcher.