Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Watcher on macOS not emitting event #72

Open
ghivert opened this issue Apr 20, 2024 · 0 comments
Open

Watcher on macOS not emitting event #72

ghivert opened this issue Apr 20, 2024 · 0 comments

Comments

@ghivert
Copy link

ghivert commented Apr 20, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant