#include #include #include #include static gboolean timeout_handler (gpointer dummy) { struct stat statbuf; static time_t old_mtime = 0; g_assert (stat ("/usr/lib/bonobo/servers", &statbuf) == 0); if (old_mtime != 0) { if (statbuf.st_mtime != old_mtime) g_print ("mtime on /usr/lib/bonobo/servers changed: was %ld, now %ld\n", (long) old_mtime, (long) statbuf.st_mtime); } old_mtime = statbuf.st_mtime; return TRUE; } int main (int argc, char **argv) { GMainLoop *main_loop; main_loop = g_main_loop_new (NULL, FALSE); g_timeout_add (1 * 1000, timeout_handler, NULL); g_main_loop_run (main_loop); g_main_loop_unref (main_loop); return 0; }