Re: basic file handling in glib.



On Thu, Sep 07, 2000 at 05:54:36PM -0400, Valdis Kletnieks vt edu wrote:
> On Thu, 07 Sep 2000 14:37:07 PDT, "Khor, Jeen Ghee" <jeen ghee khor intel com>  said:
> > why not just use standard C file i/o functions to handle the files
> > then link them to your gui ? 
> 
> I think there's a language problem, and Zin Pen doesn't realize that
> things like file selector dialogs, etc, are in the gtk library, not the glib
> library...

Not necessarily - the original message

> I am trying to create a new file, write in some stuff and 
> close it in my 
> gui, but I could not find the documentation for these 
> functions in glib.

spoke of creating a file, writing to it, and closing it, and the latter
two aren't GTK+ operations; I'd read "in my gui" as meaning that there
would be ways to "create a new file, write in some stuff and close it"
from the GUI, e.g. a "save stuff to a file" operation, not that he was
asking about stuff such as file selector dialogs.

I suspect he or she was assuming - incorrectly - that GLib includes file
I/O operations similar to those provided by the standard C file I/O
operations.

It *does* include the I/O channel operations, but those don't include
the "create a new file" operation; you'd have to do that using native OS
calls such as "open()" and "creat()" on UNIX, and then pass the file
descriptor you get back from "open()" or "creat()" to
"g_io_channel_unix_new()".

(Note: I've never used the GIOChannel stuff, I just know it exists and
have looked at the page on it in the GLib on-line documentation, so
replying to this message without CCing "gtk-list", and asking questions
about how to use it, would be a waste of time, as I couldn't answer
those questions.)




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