[Vala] Process spawn not working when the Terminal is not opened



Hi,

I'm having some issues using the Process_spawn command in an application
ready to be released. My problem is that, the Process_spawn command is not
working if a Terminal window is not opened.

For example, the "dd" command works fine if the application starts up with
an empty Terminal window. This results in something weird: I have to
display a Terminal window together with my application windows to get
everything to work!

This only happens, as far as I know, when a the Terminal command called by
Process_spawn requires Sudo permissions.

try {
          Process.spawn_async (null,
"command",
null,
SpawnFlags.SEARCH_PATH | SpawnFlags.DO_NOT_REAP_CHILD,
null,
out child_pid_format);
}
catch (SpawnError e) {
stdout.printf ("Error: %s\n", e.message);
}

Am I doing something wrong?
How can I use Process_spawn command without having to open a Terminal
window, or at least with a hidden Terminal window?

Thank you in advance,
Christian


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]