Re: File IO???



In that case its still not working :(. I'll look around a bit more. Thanks very much for your help! :)
 
Uni
----- Original Message -----
Sent: Monday, February 10, 2003 3:51 PM
Subject: RE: File IO???

No you dont.
-----Original Message-----
From: Uni [mailto:unimatrix 001 ntlworld com]
Sent: 10 February 2003 15:50
To: Russell,M,Martyn,DEN8 R
Cc: GTK App Development list
Subject: Re: File IO???

Do I have to use the 2.0 library? As I'm using Anjuta to do my project and I can't seem to get it to automatically generate the glade things (i.e. the basic window) when I choose Gnome 2.0 C...
 
Uni
----- Original Message -----
Sent: Monday, February 10, 2003 9:08 AM
Subject: RE: File IO???

Make sure you're doing the following:
 
  • including the gtk/glib libraries (e.g. "#include gtk/gtk.h" and "#include glib/glib.h" )
  • compiling against the gtk/gliblibraries (e.g. "gcc ... `pkg-config --cflags gtk+2.0 glib-2.0` ")
  • linking against the gtk/glib libraries (e.g. "gcc ... `pkg-config --libs gtk+2.0 glib-2.0` ")
 
Regards,
Martyn
-----Original Message-----
From: Uni [mailto:unimatrix 001 ntlworld com]
Sent: 07 February 2003 19:51
To: Russell,M,Martyn,DEN8 R
Cc: GTK App Development list
Subject: Re: File IO???

Hi,
 
I'm getting an error saying that there is an undefined reference to 'g_io_channel_new_file'. I'm quite sure its something I'm overlooking, but do you have any ideas?
 
Thanks,
Uni
----- Original Message -----
Sent: Friday, February 07, 2003 6:32 PM
Subject: RE: File IO???

 
Type GIOChannel *
 
Martyn
-----Original Message-----
From: Uni [mailto:unimatrix 001 ntlworld com]
Sent: 07 February 2003 18:27
To: Russell,M,Martyn,DEN8 R
Cc: GTK App Development list
Subject: Re: File IO???

Hi there,
 
Can you tell me what type 'channel' is and how I declare it? I've tried making it a type of GIOChannel but no success.
 
Uni
----- Original Message -----
Sent: Friday, February 07, 2003 5:49 PM
Subject: RE: File IO???

This is what I do when I create a log file to write to:
 
  filename = g_strdup_printf("mylog.log");
  channel = g_io_channel_new_file(filename,"a+",NULL);
 
  if(channel == NULL)
    {
      g_error("failed to create new file:'%s'",filename);
      return FALSE;
    }
 
  /* start top of log */
  message = g_strdup_printf("Log started on %s at %s\n\n", datestamp(), timestamp());
 
  g_io_channel_write_chars(channel,
                           message,
                           -1,
                           &bytes,
                           NULL);
 
  /* clean up */
  g_free(message);
and when I go to clean up the channel and close the file, I use:

  /* close file */
  g_io_channel_shutdown(channel,TRUE,NULL);
Regards,
Martyn
-----Original Message-----
From: Uni [mailto:unimatrix 001 ntlworld com]
Sent: 07 February 2003 17:12
To: Russell,M,Martyn,DEN8 R
Cc: gtk-app-devel-list gnome org
Subject: Re: File IO???

Hi there,
 
Thanks very much Martyn. Yeah I've had a look at it but the "file descriptor" that is passed into the g_io_channel_unix_new kinda confuses me. Also the g_io_channel_new_file returns a GIOChannel, although hadn't I already created one using the g_io_channel_unix_new??? I'm totally lost on it all :(...
 
Thanks
Uni
 
----- Original Message -----
Sent: Friday, February 07, 2003 4:59 PM
Subject: RE: File IO???

Have you looked at GLib IOChannels?
http://developer.gnome.org/doc/API/2.0/glib/glib-IO-Channels.html
 
Regards,
Martyn
-----Original Message-----
From: Uni [mailto:unimatrix 001 ntlworld com]
Sent: 07 February 2003 16:45
To:
gtk-app-devel-list gnome org
Subject: File IO???

Hi,
 
I'm interesting in something on File input/output with GTK+. Could anybody please point me in the direction of a tutorial or possibly give me a rough guide, as I only seem to be able to pull up the "Hello World" tutorials or the API references...
 
Thanks very much!
Uni


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