This event occurs when a file is added or removed, including (for fdio_watch_directory()
) files that already exist.
This event occurs, once, when fdio_watch_directory()
runs out of existing files and has to start waiting for new files to be added.
Call the provided callback (cb) for each file in directory and each time a new file is added to the directory.
If the callback returns a status other than ZX_OK
, watching stops and the callback's status is returned to the caller of fdio_watch_directory.
If the deadline expires, ZX_ERR_TIMED_OUT
is returned to the caller. A deadline of ZX_TIME_INFINITE
will never expire.
The callback may use ZX_ERR_STOP
as a way to signal to the caller that it wants to stop because it found what it was looking for, etc -- since this error code is not returned by syscalls or public APIs, the callback does not need to worry about it turning up normally.