AsyncDirectoryWatcher

Watches one or more directories in the local filesystem for the specified events by calling a custom event handler asynchroneously when they occur.

Usage: run() the object, start watching directories, receive an event in your handler, read the changes by draining the buffer.

Constructors

this
this(EventLoop evl)

Members

Functions

kill
bool kill()

Cleans up underlying resources.

readChanges
uint readChanges(DWChangeInfo[] dst)

Fills the buffer with file/folder events and returns the number of events consumed. Returns 0 when the buffer is drained.

run
bool run(void delegate() del)

Registers the object in the underlying event loop and sends notifications related to buffer activity by calling the specified handler.

unwatchDir
bool unwatchDir(string path, bool recursive)

Removes the directory and its files from the event watch list. Recursive will remove all subdirectories in the watch list.

watchDir
bool watchDir(string path, DWFileEvent ev, bool recursive)

Starts watching for file events in the specified directory, recursing into subdirectories will add those and its files to the watch list as well.

Mixins

__anonymous
mixin DefStatus
Undocumented in source.
__anonymous
mixin EvInfoMixins
Undocumented in source.

Properties

fd
fd_t fd [@property getter]
fd
fd_t fd [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.

Mixed In Members

From mixin DefStatus

hasError
bool hasError [@property getter]

Check this property to make sure the event loop hasn't failed

status
StatusInfo status [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
error
string error [@property getter]

Returns a human-readable error message from the underlying operating system.

From mixin EvInfoMixins

CleanupData
struct CleanupData
Undocumented in source.
evInfo
EventInfo* evInfo [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
evInfo
EventInfo* evInfo [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.

Meta