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
|
The Debian packaging of inotify-tools is maintained using dgit. For the sake
of an efficient workflow, Debian modifications to the upstream
source are squashed into a single diff, rather than a series of
quilt patches. To obtain a patch queue for package version
3.14-1:
# apt-get install dgit
% dgit clone inotify-tools
% cd inotify-tools
% git log --oneline 3.14-1..debian/3.14 -- . ':!debian'
--- inotify-tools-3.14.orig/libinotifytools/src/test.c
+++ inotify-tools-3.14/libinotifytools/src/test.c
@@ -170,12 +170,12 @@ ENTER
compare( inotifytools_wd_from_filename( "/" ), -1 );
compare( inotifytools_filename_from_wd( 1 ), 0 );
verify( inotifytools_watch_file( "/", IN_CLOSE ) );
- compare( inotifytools_wd_from_filename( "/" ), 2 );
+ int new = inotifytools_wd_from_filename( "/" );
compare( inotifytools_wd_from_filename( "foobar" ), -1 );
- verify( !strcmp( inotifytools_filename_from_wd(2), "/" ) );
- verify( inotifytools_remove_watch_by_wd( 2 ) );
+ verify( !strcmp( inotifytools_filename_from_wd(new), "/" ) );
+ verify( inotifytools_remove_watch_by_wd( new ) );
compare( inotifytools_wd_from_filename( "/" ), -1 );
- compare( inotifytools_filename_from_wd( 2 ), 0 );
+ compare( inotifytools_filename_from_wd( new ), 0 );
EXIT
}
--- inotify-tools-3.14.orig/man/inotifywait.1
+++ inotify-tools-3.14/man/inotifywait.1
@@ -305,9 +305,9 @@ do something appropriate.
.nf
#!/bin/sh
-while inotifywait -e modify /var/log/messages; do
- if tail -n1 /var/log/messages | grep httpd; then
- kdialog --msgbox "Apache needs love!"
+while inotifywait \-e modify /var/log/messages; do
+ if tail \-n1 /var/log/messages | grep httpd; then
+ kdialog \-\-msgbox "Apache needs love!"
fi
done
.fi
@@ -318,8 +318,8 @@ A custom output format is used to watch
console.
.nf
-% inotifywait -m -r --format '%:e %f' ~/test
-Setting up watches. Beware: since -r was given, this may take a while!
+% inotifywait \-m \-r \-\-format '%:e %f' ~/test
+Setting up watches. Beware: since \-r was given, this may take a while!
Watches established.
CREATE badfile
OPEN badfile
@@ -332,6 +332,14 @@ CLOSE_WRITE:CLOSE goodfile
DELETE badfile
.fi
+.SH CAVEATS
+
+When using inotifywait, the filename that is outputted is not
+guaranteed to be up to date after a move because it is the inode that
+is being monitored. Additionally, none of the observed operations are
+guaranteed to have been performed on the filename inotifywait was
+instructed to monitor in cases when the file is known by several names
+in the filesystem.
.SH BUGS
There are race conditions in the recursive directory watching code
--- inotify-tools-3.14.orig/man/inotifywatch.1
+++ inotify-tools-3.14/man/inotifywatch.1
@@ -231,7 +231,7 @@ this event can occur even if it is not e
Watching the `~/.beagle' directory for 60 seconds:
.nf
-% inotifywatch -v -e access -e modify -t 60 -r ~/.beagle
+% inotifywatch \-v \-e access \-e modify \-t 60 \-r ~/.beagle
Establishing watches...
Setting up watch(es) on /home/rohan/.beagle
OK, /home/rohan/.beagle is now being watched.
@@ -254,6 +254,15 @@ total access modify filename
2 2 0 /home/rohan/.beagle/Indexes/KMailIndex/SecondaryIndex/
.fi
+.SH CAVEATS
+
+When using inotifywatch, the filename that is outputted is not
+guaranteed to be up to date after a move because it is the inode that
+is being monitored. Additionally, none of the observed operations are
+guaranteed to have been performed on the filename inotifywatch was
+instructed to monitor in cases when the file is known by several names
+in the filesystem.
+
.SH BUGS
There are race conditions in the recursive directory watching code
which can cause events to be missed if they occur in a directory immediately
--- inotify-tools-3.14.orig/src/common.c
+++ inotify-tools-3.14/src/common.c
@@ -25,7 +25,7 @@ void print_event_descriptions() {
printf("\tmodify\t\tfile or directory contents were written\n");
printf("\tattrib\t\tfile or directory attributes changed\n");
printf("\tclose_write\tfile or directory closed, after being opened in\n"
- "\t \twriteable mode\n");
+ "\t \twritable mode\n");
printf("\tclose_nowrite\tfile or directory closed, after being opened in\n"
"\t \tread-only mode\n");
printf("\tclose\t\tfile or directory closed, regardless of read/write "
--- inotify-tools-3.14.orig/src/inotifywait.c
+++ inotify-tools-3.14/src/inotifywait.c
@@ -119,7 +119,7 @@ void validate_format( char * fmt ) {
void output_event_csv( struct inotify_event * event ) {
char *filename = csv_escape(inotifytools_filename_from_wd(event->wd));
if (filename != NULL)
- printf("%s,", csv_escape(filename));
+ printf("%s,", filename);
printf("%s,", csv_escape( inotifytools_event_to_str( event->mask ) ) );
if ( event->len > 0 )
|