Re: g_spawn_async_with_pipes
- From: David NeÄas <yeti physics muni cz>
- To: Dad <craigbakalian verizon net>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: g_spawn_async_with_pipes
- Date: Sat, 12 Feb 2011 20:52:26 +0100
On Sat, Feb 12, 2011 at 01:31:18PM -0500, Dad wrote:
If I am going to run the following command line prompt from my
application run-time ->
echo '\version "2.12" \relative {\clef "alto" c4 d e f g a b c}'
| /usr/bin/lilypond --output=myscale.png -
using g_spawn_async_with_pipes() how on earth do I set the input of
lilypond to suck up the output of echo (notice the pipe)? Am I thinking
incorrectly here?
Well, yes, you do; g_spawn_async_with_pipes() runs a program (similarly
to execve()). It does not invoke the shell. The pipes in its name
indicate that *your program* will communicate with the subprocess using
pipes, not that you pass a shell pipeline.
So, to use g_spawn_async_with_pipes() you should obtain the subprocess'
standard input â from argument standard_input â and send the input there
from your program instead of echoing it.
I am not aware of GLib wrapper that would work like system(), i.e.
invoke a shell (there was some in libgnome, IIRC).
Anyway I find it all a bit awkward: if you don't *have to* pass the data
to the standard input of lilypond isn't creating a temporary file with
the entire input simpler?
Yeti
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]