JanetDocsSourcePlaygroundTutorialsI'm Feeling luckyCommunityGitHub sign in

filewatch/listen

core-api


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

    (filewatch/listen watcher)

    Listen for changes in the 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)  # File to watch.
(filewatch/listen ww)         # Start filewatcher listening for changes.

(ev/spawn-thread              # Spawn thread to catch change events.
 (print "Waiting...")
 (forever (pp (ev/take cc))))
oofoePlayground