Janet 1.39.1-e9c6678 Documentation
(Other Versions:
1.38.0
1.37.1
1.36.0
1.35.0
1.34.0
1.31.0
1.29.1
1.28.0
1.27.0
1.26.0
1.25.1
1.24.0
1.23.0
1.22.0
1.21.0
1.20.0
1.19.0
1.18.1
1.17.1
1.16.1
1.15.0
1.13.1
1.12.2
1.11.1
1.10.1
1.9.1
1.8.1
1.7.0
1.6.0
1.5.1
1.5.0
1.4.0
1.3.1
)
Filewatch Module
Index
filewatch/add filewatch/listen filewatch/new filewatch/remove filewatch/unlisten
filewatch/add cfunction source
(filewatch/add watcher path &opt flags) Add a path to the watcher. Available flags depend on the current OS, and are as follows: Windows/MINGW (flags correspond to `FILE_NOTIFY_CHANGE_*` flags in win32 documentation): * `:all` - trigger an event for all of the below triggers. * `:attributes` - `FILE_NOTIFY_CHANGE_ATTRIBUTES` * `:creation` - `FILE_NOTIFY_CHANGE_CREATION` * `:dir-name` - `FILE_NOTIFY_CHANGE_DIR_NAME` * `:last-access` - `FILE_NOTIFY_CHANGE_LAST_ACCESS` * `:last-write` - `FILE_NOTIFY_CHANGE_LAST_WRITE` * `:security` - `FILE_NOTIFY_CHANGE_SECURITY` * `:size` - `FILE_NOTIFY_CHANGE_SIZE` * `:recursive` - watch subdirectories recursively Linux (flags correspond to `IN_*` flags from <sys/inotify.h>): * `:access` - `IN_ACCESS` * `:all` - `IN_ALL_EVENTS` * `:attrib` - `IN_ATTRIB` * `:close-nowrite` - `IN_CLOSE_NOWRITE` * `:close-write` - `IN_CLOSE_WRITE` * `:create` - `IN_CREATE` * `:delete` - `IN_DELETE` * `:delete-self` - `IN_DELETE_SELF` * `:ignored` - `IN_IGNORED` * `:modify` - `IN_MODIFY` * `:move-self` - `IN_MOVE_SELF` * `:moved-from` - `IN_MOVED_FROM` * `:moved-to` - `IN_MOVED_TO` * `:open` - `IN_OPEN` * `:q-overflow` - `IN_Q_OVERFLOW` * `:unmount` - `IN_UNMOUNT` On Windows, events will have the following possible types: * `:unknown` * `:added` * `:removed` * `:modified` * `:renamed-old` * `:renamed-new` On Linux, events will a `:type` corresponding to the possible flags, excluding `:all`.Community Examples
filewatch/listen cfunction source
(filewatch/listen watcher) Listen for changes in the watcher.Community Examples
filewatch/new cfunction source
(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.Community Examples
filewatch/remove cfunction source
(filewatch/remove watcher path) Remove a path from the watcher.Community Examples
filewatch/unlisten cfunction source
(filewatch/unlisten watcher) Stop listening for changes on a given watcher.Community Examples