FileMonitor

open class FileMonitor(pointer: <Error class: unknown class><<Error class: unknown class>>)

Monitors a file or directory for changes.

To obtain a GFileMonitor for a file or directory, use method@Gio.File.monitor, method@Gio.File.monitor_file, or method@Gio.File.monitor_directory.

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

Skipped during bindings generation

  • method cancelled: Property has no getter nor setter

  • method rate-limit: Property has no getter

Constructors

Link copied to clipboard
constructor(pointer: <Error class: unknown class><<Error class: unknown class>>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val gioFileMonitorPointer: <Error class: unknown class><<Error class: unknown class>>

Functions

Link copied to clipboard
open fun cancel(): Boolean

Cancels a file monitor.

Link copied to clipboard
fun connectChanged(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: (file: File, otherFile: File?, eventType: FileMonitorEvent) -> Unit): <Error class: unknown class>

Emitted when @file has been changed.

Link copied to clipboard
open fun emitEvent(child: File, otherFile: File, eventType: FileMonitorEvent)

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

Link copied to clipboard
open fun isCancelled(): Boolean

Returns whether the monitor is canceled.

Link copied to clipboard
open fun setRateLimit(limitMsecs: Int)

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