Unexpected behaviour of g_spawn_sync



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?
TIA,
Carlo





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