A file change watcher wrapper based on fs
Just like fs
- Mac fsevent
- Linux inotify
- Windows inotify-win (untested)
NOTE: On Linux you need to install inotify-tools.
defmodule Monitor do
use ExFSWatch, dirs: ["/tmp/fswatch"]
def callback(:stop) do
IO.puts "STOP"
end
def callback(file_path, events) do
IO.inspect {file_path, events}
end
end
iex > Monitor.start
iex > ExFSWatch.known_events
- GenEvent mode
- Unit Testing