Re: Unexpected behaviour of g_spawn_sync



On Sat, 27 Nov 2004 11:09:16 +0100
Carlo <carlo-ag libero it> wrote:

Hi all,

while running a console program (written in fortran) from my gtk
application using following call to g_spawn_sync:

   gchar  * standard_output,
          * standard_error;
   gchar ** argv;
   GError * err;

   argv = (gchar **)g_malloc (2 * sizeof (gchar *));
   argv[0] = g_strdup ("RCTL_sigma");
   argv[1] = NULL;
   ret_stat = g_spawn_sync (NULL,
                            argv,
                            NULL,
                            G_SPAWN_FILE_AND_ARGV_ZERO,
                            NULL,
                            NULL,
                            & standard_output,
                            & standard_error,
                            NULL,
                            & err);

I have the following behaviour:

1. fortran program runs correctly; I can see a new console opened and
    all of its printouts (WRITE (6,...) exec_messages);
2. g_spawn_async returns TRUE and no errors are set;
3. g_spawn_async allocates both "standard_output" and
"standard_error",
    but they both are empty.

I was expecting all printouts redirected to standard_output and all
error messages (but to say the truth, all of them are generated as
stdout) to standard_error.

I'm running gtk+-2.4.13/glib-2.4.7 under win32 (XP).

Any suggestion?
http://developer.gnome.org/doc/API/2.0/glib/glib-Spawning-Processes.html#g-spawn-async-with-pipes

-- 
Hubert Sokołowski



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