There is not yet an official logo for Genie/Vala, above image just a placeholder.
These Genie/Vala pages are no longer being updated, as I have defected. I have found BaCon to be more suited to my purposes: http://bkhome.org/bacon/
IntroductionSince early 2003 I have mostly been coding in Bash/Ash script, and I am very familiar with many of the low-level Linux/Unix utilties, especially those that are designed to work with piped stdin and stdout. As I often know how to get something done quickly using them, and I am less familiar with what is on offer amongst the Glib/libc functions (and how to use them), it is a matter of expedience if I can drop down to a shell process in a Genie program. That's mostly what this page is about.
The most relevant documentation:
This looks like an appropriate function, doesn't it? But complicated...
public bool spawn_sync (string? working_directory, string argv, string? envp, GLib.SpawnFlags _flags, GLib.SpawnChildSetupFunc? child_setup, [out string standard_output, out string standard_error, out int exit_status]) throws GLib.SpawnErrorThis one is similar to the above, but simplified, with little-used parameters removed:
public bool spawn_command_line_sync (string command_line, [out string standard_output, out string standard_error, out int exit_status]) throws GLib.SpawnErrorSo, let's use spawn_command_line_sync(). Here is a simple example that runs the echo utility application...
initMost of the above should be easily understandable, but if you are unfamiliar with Genie the out may be a mystery -- it specifies that the variable is to be passed by reference (the default is by value) -- see my page on Genie functions.
Process.spawn_command_line_sync("echo 'hey it works!'",out ret_stdout,out ret_stderr,out ret_status)
(c) Copyright 2008,2009 Barry Kauler puppylinux.com, all reproduction rights reserved.