From 613836aaa5ae2e288c08951a1167a498588cff9e Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Mon, 27 Sep 2010 04:04:38 +0200 Subject: [PATCH] inotify.7: Added section noting limiations and caveats of inotify Reported-by: Jan Kara Reported-by: Lennart Poettering Signed-off-by: Michael Kerrisk --- man7/inotify.7 | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/man7/inotify.7 b/man7/inotify.7 index 1d4ca31b8..1702fca66 100644 --- a/man7/inotify.7 +++ b/man7/inotify.7 @@ -23,7 +23,7 @@ .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" -.TH INOTIFY 7 2008-11-18 "Linux" "Linux Programmer's Manual" +.TH INOTIFY 7 2010-09-27 "Linux" "Linux Programmer's Manual" .SH NAME inotify \- monitoring file system events .SH DESCRIPTION @@ -377,10 +377,27 @@ The .BR ioctl (2) returns the number of bytes available to read from an inotify file descriptor. - +.SS Limitations and caveats Inotify monitoring of directories is not recursive: to monitor subdirectories under a directory, additional watches must be created. +This can take a significant amount time for large directory trees. + +Note that the event queue can overflow. +In this case, events are lost. +Robust applications should handle the possibility +lost events gracefully. + +The inotify API identifies affected files by filename. +However, by the time an application processes an inotify event, +the filename may already have been deleted or renamed. + +If monitoring an entire directory subtree, +and a new subdirectory is created in that tree, +be aware that by the time you create a watch for the new subdirectory, +new files may already have been created in the subdirectory. +Therefore, you may want to scan the contents of the subdirectory +immediately after adding the watch. .SH "BUGS" In kernels before 2.6.16, the .B IN_ONESHOT