Re: is there any example for "GIOChannel "?



Yes.  But first are you sure you need this for the right reason?  If you are intending on writing to a file 
(say for a log), its fine, but if you want to monitor read/write on a socket, you should use gtk_input_add().

Example:

  GIOChannel *channel;

  channel = g_io_channel_new_file(filename,"a+",NULL);

  if(channel == NULL)
    {
      g_error("failed to create new file:'%s' (channel) for log",filename);
      return FALSE;
    }

  g_io_channel_write_chars(channel,
                           message,
                           -1,
                           &bytes,
                           NULL);

  /* close file */
  g_io_channel_shutdown(channel,TRUE,NULL);

 from:    "chen.shengqi" <chen shengqi connet com tw>
 date:    Wed, 18 Sep 2002 08:44:57
 to:      gtk-app-devel-list gnome org
 subject: Re: is there any example for "GIOChannel "?



Regards,

Martyn



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