FileMonitor

class FileMonitor(**properties: Any)

Superclasses: Object

Constructors:

FileMonitor(**properties)

Methods

class FileMonitor
cancel() bool

Cancels a file monitor.

emit_event(child: File, other_file: File, event_type: FileMonitorEvent) None

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

Implementations are responsible to call this method from the [thread-default main context][g-main-context-push-thread-default] of the thread that the monitor was created in.

Parameters:
is_cancelled() bool

Returns whether the monitor is canceled.

set_rate_limit(limit_msecs: int) None

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

Parameters:

limit_msecs – a non-negative integer with the limit in milliseconds to poll for changes

Properties

class FileMonitor
props.cancelled: bool

The type of the None singleton.

props.rate_limit: int

The type of the None singleton.

Signals

class FileMonitor.signals
changed(file: File, other_file: File | None, event_type: FileMonitorEvent) None

The type of the None singleton.

Parameters:

Virtual Methods

class FileMonitor
do_cancel() bool

Cancels a file monitor.

do_changed(file: File, other_file: File, event_type: FileMonitorEvent) None

The type of the None singleton.

Parameters:
  • file

  • other_file

  • event_type

Fields

class FileMonitor
parent_instance
priv