[Vala] read a program stdout



Hi all!
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

-- 
Rodrigo Cesar Herefeld


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