On Mon, Aug 27, 2012 at 12:44 PM, Mike Gran <spk121@xxxxxxxxx> wrote: > Hi- > > So I'm taking my first stab as using GLIB for an application, and I > thought I'd give you a hopefully useful first observation on the GIO > docs. 'cause if this is what I did, somebody else did this, too. > > > It is not at all clear how to do the following in GIO style > > FILE *fp = fopen("file", "r"); > fread (buf, size, nitems, fp); > > Here's what I did. I opened up the GIO Refernce manual page, saw a > section called "GFile— File and Directory Handling", looked for functions > onreading files, saw g_file_load_contents and g_file_read. > > I rejected g_file_load_contents because my file's pretty big, so I > clicked on g_file_read. It returns a GFileInputStream, so I clicked > on that to see what I can do with that. It takes me to a "GFileInputStream" > section. None of the functions in there (g_file_input_stream_query_info, etc) > actually read data. > > So I went back to the top GIO Reference Manual page, noticed > > "Migrating to GIO" section, looked in the examples "Migrating from GnomeVFS" > "Migrating from GConf", which aren't helpful, and gave up. > (Yeah, I know I could google or whatever for the info. I'm > not asking for help here; I'm just offering my first impression.) > > So two suggestions for helping newbies. > - in the GFileInputStream section, cross-reference other functions that can > operate on GFileInputStreams > - in the "Migrating to GIO" section, consider writing a section called > "Migrating from ISO C Streams" or whatever. This is sort of a problem with gtk-doc. You just have to know about the inheritance diagram. GFileInputStream is-a GInputStream. g_input_stream_read is probably what you're looking for. > Thanks, and keep up the good work, > > Mike > > _______________________________________________ > gtk-list mailing list > gtk-list@xxxxxxxxx > https://mail.gnome.org/mailman/listinfo/gtk-list -- Jasper _______________________________________________ gtk-list mailing list gtk-list@xxxxxxxxx https://mail.gnome.org/mailman/listinfo/gtk-list