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.
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 |
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 |
flags |
flags from SpawnFlags |
user_data |
user data for |
true on success, false if an error was set |