<s>
inotify	B-Application
(	O
inode	B-Application
notify	O
)	O
is	O
a	O
Linux	B-Operating_System
kernel	I-Operating_System
subsystem	O
created	O
by	O
John	O
McCutchan	O
,	O
which	O
monitors	O
changes	O
to	O
the	O
filesystem	B-Application
,	O
and	O
reports	O
those	O
changes	O
to	O
applications	O
.	O
</s>
<s>
The	O
inotifywait	B-Application
and	O
inotifywatch	B-Application
commands	O
(	O
maintained	O
by	O
Eric	O
Curtin	O
as	O
part	O
of	O
the	O
inotify-tools	O
project	O
)	O
allow	O
using	O
the	O
inotify	B-Application
subsystem	O
from	O
the	O
command	O
line	O
.	O
</s>
<s>
One	O
major	O
use	O
is	O
in	O
desktop	B-Application
search	I-Application
utilities	O
like	O
Beagle	B-Language
,	O
where	O
its	O
functionality	O
permits	O
reindexing	B-Application
of	O
changed	O
files	O
without	O
scanning	O
the	O
filesystem	B-Application
for	O
changes	O
every	O
few	O
minutes	O
,	O
which	O
would	O
be	O
very	O
inefficient	O
.	O
</s>
<s>
inotify	B-Application
replaced	O
an	O
earlier	O
facility	O
,	O
dnotify	B-Application
,	O
which	O
had	O
similar	O
goals	O
.	O
</s>
<s>
It	O
was	O
merged	O
into	O
the	O
Linux	B-Operating_System
kernel	I-Operating_System
mainline	O
in	O
kernel	B-Operating_System
version	O
2.6.13	O
,	O
released	O
on	O
August	O
29	O
,	O
2005	O
;	O
later	O
kernel	B-Operating_System
versions	O
included	O
further	O
improvements	O
.	O
</s>
<s>
The	O
required	O
library	O
interfaces	O
were	O
added	O
into	O
the	O
GNU	B-Language
C	I-Language
Library	I-Language
(	O
glibc	B-Language
)	O
in	O
its	O
version	O
2.4	O
,	O
released	O
in	O
March	O
2006	O
,	O
while	O
the	O
support	O
for	O
inotify	B-Application
was	O
completed	O
in	O
glibc	B-Language
version	O
2.5	O
,	O
released	O
in	O
September	O
2006	O
.	O
</s>
<s>
Limitations	O
imposed	O
by	O
inotify	B-Application
include	O
the	O
following	O
:	O
</s>
<s>
Inotify	B-Application
does	O
not	O
support	O
recursively	O
watching	O
directories	O
,	O
meaning	O
that	O
a	O
separate	O
inotify	B-Application
watch	O
must	O
be	O
created	O
for	O
every	O
subdirectory	O
.	O
</s>
<s>
In	O
contrast	O
,	O
the	O
command	O
inotifywait	B-Application
does	O
provide	O
recursive	O
watching	O
of	O
directories	O
.	O
</s>
<s>
Inotify	B-Application
does	O
report	O
some	O
but	O
not	O
all	O
events	O
in	O
sysfs	B-Application
and	O
procfs	B-Application
.	O
</s>
<s>
Notification	O
via	O
inotify	B-Application
requires	O
the	O
kernel	B-Operating_System
to	O
be	O
aware	O
of	O
all	O
relevant	O
filesystem	B-Application
events	O
,	O
which	O
is	O
not	O
always	O
possible	O
for	O
networked	O
filesystems	B-Application
such	O
as	O
NFS	B-Protocol
where	O
changes	O
made	O
by	O
one	O
client	O
are	O
not	O
immediately	O
broadcast	O
to	O
other	O
clients	O
.	O
</s>
<s>
Rename	O
events	O
are	O
not	O
handled	O
directly	O
;	O
i.e.	O
,	O
inotify	B-Application
issues	O
two	O
separate	O
events	O
that	O
must	O
be	O
examined	O
and	O
matched	O
in	O
a	O
context	O
of	O
potential	O
race	O
conditions	O
.	O
</s>
<s>
There	O
are	O
a	O
number	O
of	O
advantages	O
when	O
using	O
inotify	B-Application
when	O
compared	O
to	O
the	O
older	O
dnotify	B-Application
API	O
that	O
it	O
replaced	O
.	O
</s>
<s>
With	O
dnotify	B-Application
,	O
a	O
program	O
had	O
to	O
use	O
one	O
file	B-Application
descriptor	I-Application
for	O
each	O
directory	O
that	O
it	O
was	O
monitoring	O
.	O
</s>
<s>
This	O
can	O
become	O
a	O
bottleneck	O
since	O
the	O
limit	O
of	O
file	B-Application
descriptors	I-Application
per	O
process	O
could	O
be	O
reached	O
.	O
</s>
<s>
The	O
use	O
of	O
file	B-Application
descriptors	I-Application
along	O
with	O
dnotify	B-Application
also	O
proved	O
to	O
be	O
a	O
problem	O
when	O
using	O
removable	O
media	O
.	O
</s>
<s>
Devices	O
could	O
not	O
be	O
unmounted	O
since	O
file	B-Application
descriptors	I-Application
kept	O
the	O
resource	O
busy	O
.	O
</s>
<s>
Another	O
drawback	O
of	O
dnotify	B-Application
is	O
the	O
level	O
of	O
granularity	O
,	O
since	O
programmers	O
can	O
only	O
monitor	O
changes	O
at	O
the	O
directory	O
level	O
.	O
</s>
<s>
The	O
inotify	B-Application
API	O
uses	O
fewer	O
file	B-Application
descriptors	I-Application
,	O
allowing	O
programmers	O
to	O
use	O
the	O
established	O
select	O
and	O
poll	O
interface	O
,	O
rather	O
than	O
the	O
signal	O
notification	O
system	O
used	O
by	O
dnotify	B-Application
.	O
</s>
<s>
This	O
also	O
makes	O
integration	O
with	O
existing	O
select	O
-	O
or	O
poll-based	O
libraries	O
(	O
like	O
GLib	B-Language
)	O
easier	O
.	O
</s>
