Re: [Vala] Execute external command



Jan Niklas Hasse wrote:
On Wed, May 6, 2009 at 6:55 PM, Levi Bard
<taktaktaktaktaktaktaktaktaktak gmail com> wrote:
One of GLib.Process.spawn*?

Thanks, that's what I'm looking for. I tried:

string output;
Process.spawn_sync(null, {"ls", "/"}, null,
GLib.SpawnFlags.STDERR_TO_DEV_NULL, null, output);
stdout.printf("%s\n", output);

but I'm getting:

error: Argument 6: Cannot pass value to reference or output parameter

How to fix this?

You must mark output parameters with "out":

Process.spawn_sync(/* ... */, out output);


Best Regards,

Frederik



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