Skip to content

aclemmensen/exfswatch

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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
end
iex > Monitor.start

List Events from Backend

iex > ExFSWatch.known_events

TODO

  • GenEvent mode
  • Unit Testing

About

Elixir version of fswatch.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Elixir 100.0%