JanetDocsSourcePlaygroundTutorialsI'm Feeling luckyCommunityGitHub sign in

filewatch/unlisten

core-api


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

    (filewatch/unlisten watcher)

    Stop listening for changes on a given watcher.


1 exampleSign in to add an example
Loading...
(def cc (ev/thread-chan 99))  # Sets up a message channel.
(def ww (filewatch/new cc))   # Creates the watcher.
(filewatch/add ww "ftest.janet" :all)     # Watch for all changes.
(filewatch/add ww "fadd.janet"  :modify)  # Only care if modified.
(filewatch/listen ww)         # Start filewatcher listening for changes.

(pp (ev/take cc))             # Print info on first file to change.
(filewatch/unlisten ww)       # Stop caring about changes.
                              # This allows the program to exit -- otherwise
                              # filewatcher listening thread keeps running.
oofoePlayground