Monitoring
Monitoring —
watch files for changes, and get called back if they do
Description
Details
gnome_vfs_monitor_add ()
GnomeVFSResult gnome_vfs_monitor_add (GnomeVFSMonitorHandle **handle,
const gchar *text_uri,
GnomeVFSMonitorType monitor_type,
GnomeVFSMonitorCallback callback,
gpointer user_data);
| handle : | after the call, handle will be a pointer to an operation handle
|
| text_uri : | URI to monitor
|
| monitor_type : | add a directory or file monitor
|
| callback : | function to call when the monitor is tripped
|
| user_data : | data to pass to callback
|
| Returns : | an integer representing the success of the operation
|
gnome_vfs_monitor_cancel ()
GnomeVFSResult gnome_vfs_monitor_cancel (GnomeVFSMonitorHandle *handle);
| handle : | handle of the monitor to cancel
|
| Returns : | an integer representing the success of the operation
|
enum GnomeVFSMonitorType
typedef enum {
GNOME_VFS_MONITOR_FILE,
GNOME_VFS_MONITOR_DIRECTORY
} GnomeVFSMonitorType;
enum GnomeVFSMonitorEventType
typedef enum {
GNOME_VFS_MONITOR_EVENT_CHANGED,
GNOME_VFS_MONITOR_EVENT_DELETED,
GNOME_VFS_MONITOR_EVENT_STARTEXECUTING,
GNOME_VFS_MONITOR_EVENT_STOPEXECUTING,
GNOME_VFS_MONITOR_EVENT_CREATED,
GNOME_VFS_MONITOR_EVENT_METADATA_CHANGED
} GnomeVFSMonitorEventType;
| GNOME_VFS_MONITOR_EVENT_CHANGED | file data changed
|
| GNOME_VFS_MONITOR_EVENT_DELETED | file deleted event
|
| GNOME_VFS_MONITOR_EVENT_STARTEXECUTING |
|
| GNOME_VFS_MONITOR_EVENT_STOPEXECUTING |
|
| GNOME_VFS_MONITOR_EVENT_CREATED | file created event
|
| GNOME_VFS_MONITOR_EVENT_METADATA_CHANGED | file metadata changed
|
GnomeVFSMonitorCallback ()
void (*GnomeVFSMonitorCallback) (GnomeVFSMonitorHandle *handle,
const gchar *monitor_uri,
const gchar *info_uri,
GnomeVFSMonitorEventType event_type,
gpointer user_data);
| handle : | the handle of the monitor that created the event
|
| monitor_uri : | the URI of the monitor that was triggered
|
| info_uri : | the URI of the actual file this event is concerned with (this can be different
from monitor_uri if it was a directory monitor)
|
| event_type : | what happened to info_uri
|
| user_data : | user data passed to gnome_vfs_monitor_add() when the monitor was created
|