I am trying to perform an action based on changes in the folder which are detected by synrc/fs library. I want to receive this notification every time the changes captured by fs & perform an action e.g. printing the changed filename.
I tried below code but executes only first time!
say_hello() ->
fs:start_link(fs_watcher, "/Users/foldername"),
fs:subscribe(fs_watcher),
receive
{Watcher_process, {Fs, File_event}, {ChangedFile, Type}} ->
io:format("~p was ~p ~n",[ChangedFile,File_event])
end.
Any useful help is appreciated along with link & description if possible! Thanks :)