Gio.File.prototype.monitor
function monitor(flags: Gio.FileMonitorFlags, cancellable: Gio.Cancellable): Gio.FileMonitor { // Gjs wrapper for g_file_monitor() }
Obtains a file or directory monitor for the given file, depending on the type of the file.
If cancellable is not null, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error Gio.IOErrorEnum.cancelled will be returned.
Since 2.18
- flags
a set of Gio.FileMonitorFlags
- cancellable
optional Gio.Cancellable object, null to ignore
- Returns
a Gio.FileMonitor for the given file, or null on error. Free the returned object with GObject.Object.prototype.unref.