### Class

# Gio SubprocessLauncher

since: 2.40

#### Description

    final class Gio.SubprocessLauncher : GObject.Object
    {
      /* No available fields */
    }

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.

Available since: 2.40

#### Ancestors

- GObject

#### Constructors

###### g_subprocess_launcher_new

Creates a new `GSubprocessLauncher`.

since: 2.40

#### Instance methods

###### g_subprocess_launcher_close

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

since: 2.68

###### g_subprocess_launcher_getenv

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

since: 2.40

###### g_subprocess_launcher_set_child_setup

Sets up a child setup function.

since: 2.40

###### g_subprocess_launcher_set_cwd

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

since: 2.40

###### g_subprocess_launcher_set_environ

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

since: 2.40

###### g_subprocess_launcher_set_flags

Sets the flags on the launcher.

since: 2.40

###### g_subprocess_launcher_set_stderr_file_path

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

since: 2.40

###### g_subprocess_launcher_set_stdin_file_path

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

since: 2.40

###### g_subprocess_launcher_set_stdout_file_path

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

since: 2.40

###### g_subprocess_launcher_setenv

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

since: 2.40

###### g_subprocess_launcher_spawn

Creates a `GSubprocess` given a provided varargs list of arguments.

since: 2.40

###### g_subprocess_launcher_spawnv

Creates a `GSubprocess` given a provided array of arguments.

since: 2.40

###### g_subprocess_launcher_take_fd

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.

since: 2.0

###### g_subprocess_launcher_take_stderr_fd

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

since: 2.40

###### g_subprocess_launcher_take_stdin_fd

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

since: 2.40

###### g_subprocess_launcher_take_stdout_fd

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

since: 2.40

###### g_subprocess_launcher_unsetenv

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

since: 2.40

##### Methods inherited from GObject (43)

Please see GObject for a full list of methods.

#### Properties

###### Gio.SubprocessLauncher:flags

`GSubprocessFlags` for launched processes.

since: 2.40

#### Signals

##### Signals inherited from GObject (1)

###### GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

since: 2.0