filewatch/new
core-api
cfunction
src/core/filewatch.c on line 575, column 1
(filewatch/new channel &opt default-flags)
Create a new filewatcher that will give events to a channel
channel. See `filewatch/add` for available flags.
When an event is triggered by the filewatcher, a struct containing
information will be given to channel as with `ev/give`. The
contents of the channel depend on the OS, but will contain some
common keys:
* `:type` -- the type of the event that was raised.
* `:file-name` -- the base file name of the file that triggered the
event.
* `:dir-name` -- the directory name of the file that triggered the
event.
Events also will contain keys specific to the host OS.
Windows has no extra properties on events.
Linux has the following extra properties on events:
* `:wd` -- the integer key returned by `filewatch/add` for the path
that triggered this.
* `:wd-path` -- the string path for watched directory of file. For
files, will be the same as `:file-name`, and for directories,
will be the same as `:dir-name`.
* `:cookie` -- a randomized integer used to associate related
events, such as :moved-from and :moved-to events.