Re: Monitoring directory changes with gnomevfs

On Thu, 2008-08-28 at 10:01 -0400, Damien Moore wrote:

> Can someone can give me an idea of whether the above should work or
> what I would need to do to that simple example to get it working?
> Looking at the above I don't really understand how glib would know how
> to attach the MonitorCallback to the GMainLoop, which isn't even
> running yet (if I created and started another main loop inside the
> outer loop, would it also generate callbacks?).

You're correct that you must spin the main loop for callbacks to work.
The default main loop is global, so gnome-vfs will be able to find it
and add the callback even if it's not running or passed in.

These days you should be using GIO/GVFS instead of gnome-vfs, though.
Take a look at the documentation here:

GIO is part of GLib. You can read more about main loops here:

Hans Petter

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