JanetDocsSourcePlaygroundI'm feeling luckyCommunityGitHub sign in

filewatch/add

core-api


    cfunction
    src/core/filewatch.c on line 599, column 1

    (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`.


0 examplesSign in to add an example
Loading...