where to use g_spawn_async



Hello list,
in order to redirect the output of an external process to my gtkTextView I
used the g_spawn_async function in a callback function. Is that correct? If
that, why the window wait for the complete execution of the spawned process?
I use:
 
  if( g_spawn_async_with_pipes("./", // gchar *working_directory
          command,
          NULL, //gchar **envp,
          G_SPAWN_SEARCH_PATH, //GSpawnFlags flags,
          NULL, //GSpawnChildSetupFunc child_setup,
          NULL, //gpointer user_data,
          NULL, //GPid *child_pid,
          &std_in, // gint *standard_input,
          &std_out, //gint *standard_output,
          &std_err, //gint *standard_error,
          NULL //GError **error
          )       ) {
    if(&std_out){
      GIOChannel* output = g_io_channel_unix_new(std_out);
      g_io_channel_read_chars (output, // GIOChannel *channel
          buf,    // gchar *buf
          -1,    // gsize count
          NULL,   // gsize *bytes_read,
          NULL    //GError **error
          );
    }
 
Please help me!!!!
Bye
 
Alessandro



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