Hello, On Wed, Nov 23, 2011 at 03:08:29PM -0200, Rodrigo Herefeld wrote:
I need to run a program and get the stdout data from it, for example, im python i would do: import os print(os.popen("gpg --version").read() in vala i've tryed: var ret = Posix.FILE.popen("gpg --version","r+"); string tmpret = ""; ret.scanf("%s",tmpret); Glib.stdout.printf(tmpret); But i'm getting a seg fault
See "Spawning Processes" and "IO Channels" in GLib. This tutorial explains how to do that: http://tadeboro.blogspot.com/2009/07/spawning-processes-using-glib.html Regards, Sébastien
Attachment:
pgpGD5cI5OYMX.pgp
Description: PGP signature