JanetDocsSourcePlaygroundTutorialsI'm Feeling luckyCommunityGitHub sign in
(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.