Possible errors are those from g_spawn_sync() and those
from g_shell_parse_argv().
If wait_status is non-null, the platform-specific status of
the child is stored there; see the documentation of
g_spawn_check_wait_status() for how to use and interpret this.
On Unix platforms, note that it is usually not equal
to the integer passed to exit() or returned from main().
On Windows, please note the implications of g_shell_parse_argv()
parsing command_line. Parsing is done according to Unix shell rules, not
Windows command interpreter rules.
Space is a separator, and backslashes are
special. Thus you cannot simply pass a command_line containing
canonical Windows paths, like "c:\program files\app\app.exe", as
the backslashes will be eaten, and the space will act as a
separator. You need to enclose such paths with single quotes, like
"'c:\program files\app\app.exe' 'e:\folder\argument.txt'".
A simple version of
g_spawn_sync()with little-used parameters removed, taking a command line instead of an argument vector.See
g_spawn_sync()for full details.The
command_lineargument will be parsed byg_shell_parse_argv().Unlike
g_spawn_sync(), the GLib.SpawnFlags.SEARCH_PATH flag is enabled. Note that GLib.SpawnFlags.SEARCH_PATH can have security implications, so consider usingg_spawn_sync()directly if appropriate.Possible errors are those from
g_spawn_sync()and those fromg_shell_parse_argv().If
wait_statusis non-null, the platform-specific status of the child is stored there; see the documentation ofg_spawn_check_wait_status()for how to use and interpret this. On Unix platforms, note that it is usually not equal to the integer passed toexit()or returned frommain().On Windows, please note the implications of
g_shell_parse_argv()parsingcommand_line. Parsing is done according to Unix shell rules, not Windows command interpreter rules. Space is a separator, and backslashes are special. Thus you cannot simply pass acommand_linecontaining canonical Windows paths, like "c:\program files\app\app.exe", as the backslashes will be eaten, and the space will act as a separator. You need to enclose such paths with single quotes, like "'c:\program files\app\app.exe' 'e:\folder\argument.txt'".