ExFSWatch
A file change watcher wrapper based on fs
System Support
Just like fs
- Mac fsevent
- Linux inotify
- Windows inotify-win (untested)
NOTE: On Linux you need to install inotify-tools.
Usage
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
endiex > Monitor.startList Events from Backend
iex > ExFSWatch.known_eventsTODO
- GenEvent mode
- Unit Testing