FileMonitor

Monitors a file or directory for changes.

To obtain a GFileMonitor for a file or directory, use g_file_monitor(), g_file_monitor_file(), or g_file_monitor_directory().

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][g-main-context-push-thread-default] 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).

Constructors

this
this(GFileMonitor* gFileMonitor, bool ownedRef = false)

Sets our main struct and passes it to the parent class.

Members

Functions

addOnChanged
gulong addOnChanged(void delegate(FileIF, FileIF, GFileMonitorEvent, FileMonitor) dlg, ConnectFlags connectFlags = cast(ConnectFlags)0)

Emitted when file has been changed.

cancel
bool cancel()

Cancels a file monitor.

emitEvent
void emitEvent(FileIF child, FileIF otherFile, GFileMonitorEvent eventType)

Emits the changed signal if a change has taken place. Should be called from file monitor implementations only.

getFileMonitorStruct
GFileMonitor* getFileMonitorStruct(bool transferOwnership = false)

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

isCancelled
bool isCancelled()

Returns whether the monitor is canceled.

setRateLimit
void setRateLimit(int limitMsecs)

Sets the rate limit to which the monitor will report consecutive change events to the same file.

Static functions

getType
GType getType()

Variables

gFileMonitor
GFileMonitor* gFileMonitor;

the main Gtk struct