Monitors a file or directory for changes.
To get informed about changes to the file or directory you are monitoring, connect to the “changed” signal. The signal will be emitted in the thread-default main context of the thread that the monitor was created in (though if the global default main context is blocked, this may cause notifications to be blocked even if the thread-default context is still running).
Cancels a file monitor.
Returns whether the monitor is canceled.
void g_file_monitor_set_rate_limit (
Sets the rate limit to which the
consecutive change events to the same file.
a non-negative integer with the limit in milliseconds to poll for changes
void g_file_monitor_emit_event (
Emits the “changed” signal if a change has taken place. Should be called from file monitor implementations only.
Implementations are responsible to call this method from the thread-default main context of the thread that the monitor was created in.
Specifies what type of event a monitor event is.
a file changed.
a hint that this was probably the last change in a set of changes.
a file was deleted.
a file was created.
a file attribute was changed.
the file location will soon be unmounted.
the file location was unmounted.
the file was moved -- only sent if the
the file was renamed within the
current directory -- only sent if the
the file was moved into the
monitored directory from another location -- only sent if the
the file was moved out of the
monitored directory to another location -- only sent if the
Whether the monitor has been cancelled.
Default value: FALSE
void user_function (GFileMonitor *monitor, GFile *file, GFile *other_file, GFileMonitorEvent event_type, gpointer user_data)
has been changed.
G_FILE_MONITOR_WATCH_MOVES on a directory monitor, and
the information is available (and if supported by the backend),
In all cases
will be a child of the monitored directory. For
will be the old name and
is the new
name. For "moved in" events,
is the name of the file that
is the old name that it was moved from (in
another directory). For "moved out" events,
is the name of
the file that used to be in this directory and
name of the file at its new location.
It makes sense to treat
G_FILE_MONITOR_EVENT_MOVED_OUT as equivalent to
G_FILE_MONITOR_EVENT_DELETED, with extra information.
G_FILE_MONITOR_EVENT_RENAMED is equivalent to a delete/create
pair. This is exactly how the events will be reported in the case
G_FILE_MONITOR_WATCH_MOVES flag is not in use.
If using the deprecated flag
G_FILE_MONITOR_SEND_MOVED flag and
will be set to a GFile containing the
old path, and
will be set to a GFile containing the new path.
In all the other cases,
will be set to NULL.
Flags: Run Last