FSEvent
– fs event handle¶
-
class
uv.
FSEvent
(path=None, flags=0, loop=None, on_event=None)[source]¶ FS event handles monitor a given filesystem path for changes including renaming und deletion after they have been started. This handle uses the best backend available for this job on each platform.
-
path
¶ Directory or filename to monitor.
Warning
This property is writable, however you need to restart the handle if you change it during the handle is active.
Readonly: False Type: unicode
-
flags
¶ Flags to be used for monitoring.
Warning
This property is writable, however you need to restart the handle if you change it during the handle is active.
Readonly: False Type: int
-
on_event
¶ Callback which should be called on filesystem events.
-
on_event
(fs_event, status, filename, events) Parameters: - fs_event (uv.FSEvent) – handle the call originates from
- status (uv.StatusCode) – may indicate any errors
- filename (unicode) – if the handle has been started with a directory this will be a relative path to a file contained in that directory which triggered the events
- events (int) – bitmask of the triggered events
Readonly: False Type: Callable[[uv.FSEvent, uv.StatusCode, unicode, int], None] -
-
start
(path=None, flags=None, on_event=None)[source]¶ Start watching for filesystem events.
Raises: - uv.UVError – error while starting the handle
- uv.ClosedHandleError – handle has already been closed or is closing
Parameters: - path (unicode) – directory or filename to monitor (overrides the current path if specified)
- flags (int) – flags to be used for monitoring (overrides the current flags if specified)
- on_event (Callable[[uv.FSEvent, uv.StatusCode, unicode, int], None]) – callback which should be called on filesystem events (overrides the current callback if specified)
-
-
class
uv.
FSEvents
[source]¶ Events reported by
uv.FSEvent
on filesystem changes.-
RENAME
= None¶ File has been renamed or deleted. If the file has been deleted it is necessary (at least on Linux) to restart the corresponding watcher even if the file has been directly recreated.
Type: uv.FSEvents
-
CHANGE
= None¶ File has been changed.
Type: uv.FSEvents
-
-
class
uv.
FSEventFlags
[source]¶ Flags to configure the behavior of
uv.FSEvent
.-
WATCH_ENTRY
= None¶ By default, if the fs event watcher is given a directory name, it will watch for all events in that directory. This flag overrides this behavior and makes
uv.FSEvent
report only changes to the directory entry itself. This flag does not affect individual files watched.Note
This flag is currently not implemented yet on any backend.
Type: uv.FSEventFlags
-
STAT
= None¶ By default
uv.FSEvent
will try to use a kernel interface such as inotify or kqueue to detect events. This may not work on remote filesystems such as NFS mounts. This flag makesuv.FSEvent
fall back to calling stat() on a regular interval.Note
This flag is currently not implemented yet on any backend.
Type: uv.FSEventFlags
-
RECURSIVE
= None¶ By default, if the fs event watcher is given a directory name, it will not watch for events in its subdirectories. This flag overrides this behavior and makes
uv.FSEvent
report also changes in subdirectories.Note
Currently the only supported platforms are OSX and Windows.
Type: uv.FSEventFlags
-