Watcher on macOS not emitting event
ghivert opened this issue · 0 comments
ghivert commented
Hi!
I'm trying to use fs
with start_link
on macOS (last version, 14.4.1, with Erlang/OTP 26), to watch my source files, and I don't know if I'm using it wrongly or if I encountered a bug. I have a minimal reproducible example here:
The structure of the project is:
fs_test
├─ rebar.config
└─ src
├─ module_2.erl
└─ fs_test.erl
And in fs_test.erl
, I have
-module(fs_test).
-export([main/1]).
main(_) ->
fs:start_link(file_watcher, "src"),
fs:start_looper(file_watcher),
timer:sleep(infinity).
I'm launching the script from the root folder (fs_test
here), and when I try to save or modify any file in src
folder, nothing happen. However, when I change fs:start_link(file_watcher, "src")
to fs:start_link(file_watcher, ".")
, it's working. I can live with the workaround right now, but I'd like to understand what's happening under the hood. 🙂
Am I missing something? Should I avoid relative links with fs
?