forked from massemanet/inotify
-
Notifications
You must be signed in to change notification settings - Fork 2
/
README
45 lines (36 loc) · 1.29 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
Introduction
------------
Inotify is on erlang port for the Linux inotify API allowing one to monitor
changes to files and directory in the filesystem.
Installation
------------
git clone https://github.com/define-null/inotify.git
cd inotify
make
Using inotify example:
-------------
Erl console:
> Mask = all.
> Callback = self().
> inotify_server:add_watch("/tmp/somefile", Mask, Callback).
{ok,<0.73.0>}
Bash:
touch /tmp/somefile
Erl console:
> flush().
Shell got {<0.83.0>,{inotify_event,"/tmp/mu2",[open],0,[]}}
Shell got {<0.83.0>,{inotify_event,"/tmp/mu2",[attrib],0,[]}}
Shell got {<0.83.0>,{inotify_event,"/tmp/mu2",[close_write],0,[]}}
Also add_watch_link/3 is availuable, to link with handler process.
Mask is the one from http://www.kernel.org/doc/man-pages/online/pages/man7/inotify.7.html
Callback could be a pid(), function(pid(), inotify_event()) and {Mod, Fun}.
License
-------
In short, you can do anything you want with the code including using it as part
of you plan for world domination (if your successful can I have one of the nicer
countries please). No responsiblity it taken for the fitness of the any purpose,
etc, etc. The only thing I ask is that if you find a bug and fix send me the
patch. Likewise, feature suggestions and patches are welcome.
TODO
----
* Write more documentation!