gio.file_monitor

Module for FileMonitor class

Types 3

Monitors a file or directory for changes.

To obtain a gio.file_monitor.FileMonitor for a file or directory, use gio.file.File.monitor, gio.file.File.monitorFile, or gio.file.File.monitorDirectory.

To get informed about changes to the file or directory you are monitoring, connect to the gio.file_monitor.FileMonitor.changed signal. The signal will be emitted in the thread-default main context (see glib.main_context.MainContext.pushThreadDefault) 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).

Methods
GType _gType() @property
FileMonitor self()Returns `this`, for use in `with` statements.
FileMonitorGidBuilder builder()Get builder for [gio.file_monitor.FileMonitor] Returns: New builder object
bool cancelled() @propertyGet `cancelled` property. Returns: Whether the monitor has been cancelled.
int rateLimit() @propertyGet `rateLimit` property. Returns: The limit of the monitor to watch for changes, in milliseconds.
void rateLimit(int propval) @propertySet `rateLimit` property. Params: propval = The limit of the monitor to watch for changes, in milliseconds.
bool cancel()Cancels a file monitor. Returns: always true
void emitEvent(gio.file.File child, gio.file.File otherFile, gio.types.FileMonitorEvent eventType)Emits the #GFileMonitor::changed signal if a change has taken place. Should be called from file monitor implementations only.
bool isCancelled()Returns whether the monitor is canceled. Returns: true if monitor is canceled. false otherwise.
void setRateLimit(int limitMsecs)Sets the rate limit to which the monitor will report consecutive change events to the same file.
gulong connectChanged(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == void) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gio.file.File))) && (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] : gio.file.File))) && (Parameters!T.length < 3 || (ParameterStorageClassTuple!T[2] == ParameterStorageClass.none && is(Parameters!T[2] == gio.types.FileMonitorEvent))) && (Parameters!T.length < 4 || (ParameterStorageClassTuple!T[3] == ParameterStorageClass.none && is(Parameters!T[3] : gio.file_monitor.FileMonitor))) && Parameters!T.length < 5)Connect to `Changed` signal.
Constructors
this(void * ptr, Flag!"Take" take)

Fluent builder implementation template for gio.file_monitor.FileMonitor

Methods
T rateLimit(int propval)Set `rateLimit` property. Params: propval = The limit of the monitor to watch for changes, in milliseconds. Returns: Builder instance for fluent chaining

Fluent builder for gio.file_monitor.FileMonitor

Methods
FileMonitor build()Create object from builder. Returns: New object