GTK+ Forums Forum Index GTK+ Forums
Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Using a pipe in a g_spawn call

 
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming
Author Message
dreblen
Never Seen the Sunlight


Joined: 14 Jun 2007
Posts: 936
Location: Falun, WI USA

PostPosted: Sat Oct 04, 2008 3:19 am    Post subject: Using a pipe in a g_spawn call Reply with quote

Hi,
I'm trying to use a g_spawn call to handle a pipe. I'm calling glib-genmarshal from my program, and I'd like to avoid having to create a marhallers.list file.
The command I'm trying to get to work is this:
Code: (C)
1
g_spawn_command_line_sync("echo VOID:INT,INT | glib-genmarshal --stdinc --body", &output, NULL, NULL, &error);

but this results in output holding the command that was passed to g_spawn.
error is still NULL and the function returns TRUE (indicating success).
So my question is this: Does anyone know how to use a pipe with a g_spawn call (I can use g_spawn_sync if necessary, but I'd prefer to use g_spawn_command_line_sync).
Thank you...
Back to top
Nameless
Familiar Face


Joined: 28 Jun 2008
Posts: 19

PostPosted: Mon Oct 06, 2008 3:07 pm    Post subject: Reply with quote

Does output hold the string "echo VOID:INT,INT | glib-genmarshal --stdinc --body", then?

You could use g_spawn_async_with_pipes, g_spawn_command_line_sync seems to use it internally, anyway.
Back to top
wxfish
Familiar Face


Joined: 19 Sep 2008
Posts: 30

PostPosted: Tue Oct 07, 2008 3:20 am    Post subject: Reply with quote

Is it?
g_spawn_command_line_sync("/bin/sh -c 'echo VOID:INT,INT | glib-genmarshal --stdinc --body'", &str, NULL, NULL ,NULL);
Back to top
Display posts from previous:   
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming All times are GMT
Page 1 of 1

 


Powered by phpBB © 2001, 2005 phpBB Group
CodeBB 1.0 Beta 2
Protected by Anti-Spam ACP