spawnAsync

fnbool spawnAsync(string workingDirectory, string[] argv, string[] envp, glib.types.SpawnFlags flags, glib.types.SpawnChildSetupFunc childSetup, out glib.types.Pid childPid)

Executes a child program asynchronously.

See [glib.global.spawnAsyncWithPipes] for a full description; this function simply calls the [glib.global.spawnAsyncWithPipes] without any pipes.

You should call [glib.global.spawnClosePid] on the returned child process reference when you don't need it any more.

If you are writing a GTK application, and the program you are spawning is a graphical application too, then to ensure that the spawned program opens its windows on the right screen, you may want to use #GdkAppLaunchContext, #GAppLaunchContext, or set the DISPLAY environment variable.

Note that the returned child_pid on Windows is a handle to the child process and not its identifier. Process handles and process identifiers are different concepts on Windows.

Parameters

workingDirectorychild's current working directory, or null to inherit parent's
argvchild's argument vector
envpchild's environment, or null to inherit parent's
flagsflags from #GSpawnFlags
childSetupfunction to run in the child just before exec()
childPidreturn location for child process reference, or null

Returns

true on success, false if error is set

Throws

[ErrorWrap]