### Class

# Gio FileMonitor

#### Description [src]

    abstract class Gio.FileMonitor : GObject.Object
    {
      /* No available fields */
    }

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 `GFileMonitor::changed` signal. The signal will be emitted in the thread-default main context (see `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).

#### Ancestors

- GObject

#### Instance methods

###### g_file_monitor_cancel

Cancels a file monitor.

###### g_file_monitor_emit_event

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

###### g_file_monitor_is_cancelled

Returns whether the monitor is canceled.

###### g_file_monitor_set_rate_limit

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

##### Methods inherited from GObject (43)

Please see GObject for a full list of methods.

#### Properties

###### Gio.FileMonitor:cancelled

Whether the monitor has been cancelled.

###### Gio.FileMonitor:rate-limit

The limit of the monitor to watch for changes, in milliseconds.

#### Signals

###### Gio.FileMonitor::changed

Emitted when `file` has been changed.

##### Signals inherited from GObject (1)

###### GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

#### Class structure

    struct GioFileMonitorClass {
      GObjectClass parent_class;
      void (* changed) (
        GFileMonitor* monitor,
        GFile* file,
        GFile* other_file,
        GFileMonitorEvent event_type
      );
      gboolean (* cancel) (
        GFileMonitor* monitor
      );
      void (* _g_reserved1) (
    void
      );
      void (* _g_reserved2) (
    void
      );
      void (* _g_reserved3) (
    void
      );
      void (* _g_reserved4) (
    void
      );
      void (* _g_reserved5) (
    void
      );

    }

No description available.

###### Class members

`parent_class: GObjectClass`

  No description available.

`changed: void (* changed) ( GFileMonitor* monitor, GFile* file, GFile* other_file, GFileMonitorEvent event_type )`

  No description available.

`cancel: gboolean (* cancel) ( GFileMonitor* monitor )`

  No description available.

`_g_reserved1: void (* _g_reserved1) ( void )`

  No description available.

`_g_reserved2: void (* _g_reserved2) ( void )`

  No description available.

`_g_reserved3: void (* _g_reserved3) ( void )`

  No description available.

`_g_reserved4: void (* _g_reserved4) ( void )`

  No description available.

`_g_reserved5: void (* _g_reserved5) ( void )`

  No description available.

#### Virtual methods

###### Gio.FileMonitorClass.cancel

Cancels a file monitor.

###### Gio.FileMonitorClass.changed

No description available.