||r||Whether the monitor has been cancelled|
||r/w/en||The limit of the monitor to watch for changes, in milliseconds|
||Emitted when file has been changed.|
Abstract: Yes Structure:
Monitors a file or directory for changes.
To get informed about changes to the file or directory you are monitoring, connect to the
::changedsignal. The signal will be emitted in the
thread-default main contextof 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).
emit_event(child, other_file, event_type)¶
Implementations are responsible to call this method from the
thread-default main contextof the thread that the monitor was created in.
Trueif monitor is canceled.
Returns whether the monitor is canceled.
Parameters: limit_msecs (
int) – a non-negative integer with the limit in milliseconds to poll for changes
Sets the rate limit to which the self will report consecutive change events to the same file.
changed(file_monitor, file, other_file, event_type)¶
Emitted when file has been changed.
Gio.FileMonitorFlags.WATCH_MOVESon a directory monitor, and the information is available (and if supported by the backend), event_type may be
In all cases file will be a child of the monitored directory. For renames, file will be the old name and other_file is the new name. For “moved in” events, file is the name of the file that appeared and other_file is the old name that it was moved from (in another directory). For “moved out” events, file is the name of the file that used to be in this directory and other_file is the name of the file at its new location.
It makes sense to treat
Gio.FileMonitorEvent.MOVED_INas equivalent to
Gio.FileMonitorEvent.MOVED_OUTas equivalent to
Gio.FileMonitorEvent.DELETED, with extra information.
Gio.FileMonitorEvent.RENAMEDis equivalent to a delete/create pair. This is exactly how the events will be reported in the case that the
Gio.FileMonitorFlags.WATCH_MOVESflag is not in use.
If using the deprecated flag
Gio.FileMonitorFlags.SEND_MOVEDflag and event_type is
Gio.FileMonitorEvent.MOVED, file will be set to a
Gio.Filecontaining the old path, and other_file will be set to a
Gio.Filecontaining the new path.
In all the other cases, other_file will be set to
Whether the monitor has been cancelled