views:

77

answers:

2

Hi.

I would like to execute a command (like ls) in Vala, like the Python os.system function, or, better, the popen function. Any idea ?

+2  A: 

OK, got it : Glib.Process.spawn_command_line_sync.

NowhereToHide
you can accept your own answer ;) or is there something to clear?
elmarco
In fact, it seems to be complicated to use under Windows, but on the other hand I don't need it anymore.
NowhereToHide
+1  A: 

It's best to use the package posix. Then, just do Posix.system("command") which returns an int.

http://www.valadoc.org/posix/Posix.system.html

jcao219