GnomeVFS - Filesystem Abstraction library | ||||
---|---|---|---|---|
Top | Description |
Synopsis
typedef GnomeVFSMonitorHandle; enum GnomeVFSMonitorType; enum GnomeVFSMonitorEventType; void (*GnomeVFSMonitorCallback) (GnomeVFSMonitorHandle *handle, const gchar *monitor_uri, const gchar *info_uri, GnomeVFSMonitorEventType event_type, gpointer user_data); GnomeVFSResult gnome_vfs_monitor_add (GnomeVFSMonitorHandle **handle, const gchar *text_uri, GnomeVFSMonitorType monitor_type, GnomeVFSMonitorCallback callback, gpointer user_data); GnomeVFSResult gnome_vfs_monitor_cancel (GnomeVFSMonitorHandle *handle); void gnome_vfs_monitor_callback (GnomeVFSMethodHandle *method_handle, GnomeVFSURI *info_uri, GnomeVFSMonitorEventType event_type);
Details
GnomeVFSMonitorHandle
typedef struct GnomeVFSMonitorHandle GnomeVFSMonitorHandle;
a handle representing a file or directory monitor that
was registered using gnome_vfs_monitor_add()
and that
can be cancelled using gnome_vfs_monitor_cancel()
.
enum GnomeVFSMonitorType
typedef enum { GNOME_VFS_MONITOR_FILE, GNOME_VFS_MONITOR_DIRECTORY } GnomeVFSMonitorType;
Type of resources that can be monitored.
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;
Types of events that can be monitored.
file data changed (FAM, inotify). | |
file deleted event (FAM, inotify). | |
file was executed (FAM only). | |
executed file isn't executed anymore (FAM only). | |
file created event (FAM, inotify). | |
file metadata changed (inotify only). |
GnomeVFSMonitorCallback ()
void (*GnomeVFSMonitorCallback) (GnomeVFSMonitorHandle *handle, const gchar *monitor_uri, const gchar *info_uri, GnomeVFSMonitorEventType event_type, gpointer user_data);
Function called when a monitor detects a change.
|
the handle of the monitor that created the event |
|
the URI of the monitor that was triggered |
|
the URI of the actual file this event is concerned with (this can be different
from monitor_uri if it was a directory monitor)
|
|
what happened to info_uri
|
|
user data passed to gnome_vfs_monitor_add() when the monitor was created
|
gnome_vfs_monitor_add ()
GnomeVFSResult gnome_vfs_monitor_add (GnomeVFSMonitorHandle **handle, const gchar *text_uri, GnomeVFSMonitorType monitor_type, GnomeVFSMonitorCallback callback, gpointer user_data);
Watch the file or directory at text_uri
for changes (or the creation/deletion of the file)
and call callback
when there is a change. If a directory monitor is added, callback
is
notified when any file in the directory changes.
|
after the call, handle will be a pointer to an operation handle.
|
|
string representing the uri to monitor. |
|
add a directory or file monitor. |
|
function to call when the monitor is tripped. |
|
data to pass to callback .
|
Returns : |
an integer representing the result of the operation. |
gnome_vfs_monitor_cancel ()
GnomeVFSResult gnome_vfs_monitor_cancel (GnomeVFSMonitorHandle *handle);
Cancel the monitor pointed to be handle
.
|
handle of the monitor to cancel. |
Returns : |
an integer representing the result of the operation. |
gnome_vfs_monitor_callback ()
void gnome_vfs_monitor_callback (GnomeVFSMethodHandle *method_handle, GnomeVFSURI *info_uri, GnomeVFSMonitorEventType event_type);
gnome_vfs_monitor_callback()
is used by GnomeVFSMethods to indicate that a particular
resource changed, and will issue the emission of the GnomeVFSMonitorCallback registered
using gnome_vfs_monitor_add()
.
|
Method-specific monitor handle obtained through gnome_vfs_monitor_add() .
|
|
URI that triggered the callback. |
|
The event obtained for info_uri .
|