-
Notifications
You must be signed in to change notification settings - Fork 7
/
README
136 lines (86 loc) · 3.65 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
*********************************************************************
** WARNING: This is not the "official" repository anymore. **
** Please obtain use this repository instead: **
** **
** https://github.com/libinotify-kqueue/libinotify-kqueue **
*********************************************************************
libinotify-kqueue
=================
Copyright (c) 2011-2014 Dmitry Matveev <me@dmitrymatveev.co.uk>
The purpose of this library is to provide inotify API on the
*BSD family of operating systems. The library uses kqueue(2)
to monitor the file system activity.
Requirements
------------
- gcc, g++, automake, autoconf, libtool;
- NetBSD, OpenBSD, FreeBSD (all tested), Mac OS X (reported
to work).
Downloading
-----------
This project does not have a special home page yet. The source
code and the issue tracker are hosted on Github:
https://github.com/dmatveev/libinotify-kqueue
Building
--------
Building from a git snaphost is as simple as:
$ autoreconf -fvi
$ ./configure
$ make
Testing
-------
After you build the library, you can run tests to ensure that
everything works in your system:
$ make test
There are 60+ tests, and since some events cann't be implemented
using only userspace kqueue(2), this test will always fail:
> In test "Open/close notifications":
> failed: receive IN_OPEN on cat
> failed: receive IN_CLOSE_NOWRITE on cat
> failed: receive IN_OPEN on ls
> failed: receive IN_CLOSE_NOWRITE on ls
> failed: receive IN_OPEN on modify
> failed: receive IN_CLOSE_WRITE on modify
Sometimes these cheks will also fail:
> In test "Directory notifications":
> failed: receive IN_DELETE_SELF on removing a directory
> failed: receive IN_IGNORED on removing a directory
It is a known problem and it is going to be fixed. If you will get
any other results, please feel free to report it at:
https://github.com/dmatveev/libinotify-kqueue/issues
Using
-----
To use the library, all you need to do is to link your application
with it (adding -linotify to LDFLAGS works in almost all cases).
Of course, you will need to have include (-I) and linker (-L)
directories to be properly set in your project.
Since the heart of the library is kqueue(2), the library has to
keep many files open to provide proper monitoring. It is especially
important when you monitor a single but large directory - EVERY file
in this directory will be opened by a library. You can run out of
file descriptors, so do not forget request more with setrlimit(2)
before starting monitoring.
Note that fcntl(2) calls are not supported on descriptors returned
by the library's inotify_init().
Status
------
The library is feature-complete, i.e. it implements and provides
everything what can be implemented/provided using kqueue(2). The
support of the remaining events (listed in the "Testing" section)
will be added as soon as it will be possible to do with kqueue(2)
(or using other tools in the userspace) in all major supported
operating systems.
The other point is the performance, and the directory difference
algorithm used in libinotify-kqueue can be optimized. It is the
primary scope of the future work on the library.
Thanks
------
Thanks to Julio Merino for mentoring my work during the initial
library development on Google Summer Of Code 2011.
Thanks to Antoine Jacoutot for support, reports, and the work
on the related glib-kqueue project.
Thanks to bugreporters: Baptiste Daroussin, Stanislav Sedov,
Dmitry Okunev, luoqi-git.
License
-------
libinotify-kqueue is redistributed under the terms of MIT License.
See file LICENSE for details.