How to stop a file watching task in Julia 1.8? Possible regression?

How about?

import FileWatching: watch_folder
function watch_folder(f, path::AbstractString)
     while true
         f(watch_folder(path))
     end
end

I was able to run your original example with that function instead.

watch_task = @async watch_folder(".") ...
1 Like