Linux inotify for Erlang

Inotify is on erlang port for the Linux inotify API allowing one to monitor changes to files and directory in the filesystem.

Example

inotify_demo() ->
     inotify:start(x,y),
     TmpDir = inotify:watch("/tmp/", ?ALL),
     inotify:add_handler(TmpDir, ?MODULE, self()),

     file:open("/tmp/foo_bar_inotify_test", [read, write]),

     receive
         {[create],0,"foo_bar_inotify_test"} ->
             io:format("Yeah!~n");
     end.

For the full example refer to the unit test: https://github.com/sheyll/inotify/blob/master/test/inotify_test.erl

Release History