You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have code like the following to watch two directories. I only care about getting a notification when the directory is updated. For my use-case, I don't care about receiving notifications for #individual files getting changed.
With this code, when I create multiple files inside one of my watched directories e.g. by running mix new test inside one watched directory, after 2s (the latency set above) I get lots of notifications in my handle_info (I'm using a GenServer, as specified in your Readme) for all the files that just got created. (Similarly when I do a rm -rf watched_dir/another_dir — I get lots of notifications too)
I would like to only get one notification that the directory has been updated. How do I do this with file_system?
The text was updated successfully, but these errors were encountered:
Hi @debajit
I think you have to do the filter yourself for now.
First, different backends have different behavior for different system, I guess you're using macos, but for Linux, it seems inotify backend doesn't have the latency config.
And then, I think it's very easy to do this with another gen_server process.
What Can I do:
I forgot the reason I think recursive is enabled for macos and no option to disable it, will do a research and try to add it back.
I'll test latency option, I'm not sure we get only one message totally or each message for each file change durning the latency time.
I have the same request. However, I want to do that with the FSPoll backend.
BTW, I found by reading the code that the FSPoll backend doesn't send the change event for directories.
I have code like the following to watch two directories. I only care about getting a notification when the directory is updated. For my use-case, I don't care about receiving notifications for #individual files getting changed.
With this code, when I create multiple files inside one of my watched directories e.g. by running
mix new test
inside one watched directory, after 2s (the latency set above) I get lots of notifications in myhandle_info
(I'm using a GenServer, as specified in your Readme) for all the files that just got created. (Similarly when I do arm -rf watched_dir/another_dir
— I get lots of notifications too)I would like to only get one notification that the directory has been updated. How do I do this with
file_system
?The text was updated successfully, but these errors were encountered: