#include <assert.h>
#include <stdlib.h>
#include <stdio.h>

#include <gio/gio.h>
#include <gtk/gtk.h>

static gboolean
callback (GFileMonitor *monitor,
          GFile *file,
          GFile *other_file,
          GFileMonitorEvent event_type,
          gpointer user_data)
{
    fprintf(stderr, "************ Got callback\n");
    return TRUE;
}

void main(void)
{
    GFile* gfile = g_file_new_for_path("/tmp/dat");
    GFileMonitor* monitor = g_file_monitor (gfile, G_FILE_MONITOR_NONE, NULL, NULL);
    if (! monitor)
    {
        fprintf(stderr, "Error!\n");
        return;
    }

    g_signal_connect (monitor, "changed",
                      (GCallback) callback, NULL);

    gtk_main();
}

