test for existence, if it doesn't exist, unshare (obviously). if it does
GFileMonitor *monitor = g_file_monitor (the_shared_directory, ...);
g_signal_connect (monitor, "changed", monitor_cb, ...);
...
static void
monitor_cb (GFileMonitor *monitor, GFile *file, GFile *unused, GFileMonitorEvent event, gpointer user_data)
{
switch (event)
{
case G_FILE_MONITOR_EVENT_DELETED:
unshare folder
break;
}
}
Or the inotify/fam/fsnotify/other file monitoring APIs in your language binding, or if you're really desperate (read: don't be this desperate; g_file_monitor() has a polling backend for desperate, no-native-file-monitoring platforms), check on startup and poll. This will work even if the folder is rmdir'd.
Or, g_file_monitor().
test for existence, if it doesn't exist, unshare (obviously). if it does directory, ...); MONITOR_ EVENT_DELETED:
GFileMonitor *monitor = g_file_monitor (the_shared_
g_signal_connect (monitor, "changed", monitor_cb, ...);
...
static void
monitor_cb (GFileMonitor *monitor, GFile *file, GFile *unused, GFileMonitorEvent event, gpointer user_data)
{
switch (event)
{
case G_FILE_
unshare folder
break;
}
}
Or the inotify/ fam/fsnotify/ other file monitoring APIs in your language binding, or if you're really desperate (read: don't be this desperate; g_file_monitor() has a polling backend for desperate, no-native- file-monitoring platforms), check on startup and poll. This will work even if the folder is rmdir'd.