spawn_sync


Description:

public bool spawn_sync (string? working_directory, string[] argv, string[]? envp, SpawnFlags _flags, SpawnChildSetupFunc? child_setup, out string standard_output = null, out string standard_error = null, out int exit_status = null) throws SpawnError

Executes a child synchronously (waits for the child to exit before returning).

All output from the child is stored in standard_output and standard_error, if those parameters are non- null. Note that you must set the g_spawn_stdout_to_dev_null and g_spawn_stderr_to_dev_null flags when passing null for standard_output and standard_error.

If exit_status is non-null, the platform-specific exit status of the child is stored there; see the documentation of check_exit_status for how to use and interpret this. Note that it is invalid to pass g_spawn_do_not_reap_child in flags .

If an error occurs, no data is returned in standard_output, standard_error, or exit_status.

This function calls spawn_async_with_pipes internally; see that function for full details on the other parameters and details on how these functions work on Windows.

Parameters:

working_directory

child's current working directory, or null to inherit parent's

argv

child's argument vector

envp

child's environment, or null to inherit parent's

child_setup

function to run in the child just before exec

standard_output

return location for child output, or null

standard_error

return location for child error messages, or null

exit_status

return location for child exit status, as returned by waitpid, or null

flags

flags from SpawnFlags

user_data

user data for child_setup

Returns:

true on success, false if an error was set


Namespace: GLib.Process
Package: glib-2.0