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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
// This file is part of file-descriptors. It is subject to the license terms in the COPYRIGHT file found in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/file-descriptors/master/COPYRIGHT. No part of file-descriptors, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the COPYRIGHT file.
// Copyright © 2018-2019 The developers of file-descriptors. See the COPYRIGHT file in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/file-descriptors/master/COPYRIGHT.
extern "C"
/// File was accessed (read).
///
/// When monitoring a directory, this event can occur for files in the directory, in which case the `name` field in the returned `inotify_event` from `read()` structure identifies the name of the file within the directory.
///
/// Valid for `inotify_add_watch()`'s `mask` argument.
/// Can be set in the `mask` field of the `inotify_event` structure returned from `read()`.
pub const IN_ACCESS: u32 = 0x00000001;
/// File was modified.
///
/// When monitoring a directory, this event can occur for files in the directory, in which case the `name` field in the returned `inotify_event` from `read()` structure identifies the name of the file within the directory.
///
/// Valid for `inotify_add_watch()`'s `mask` argument.
/// Can be set in the `mask` field of the `inotify_event` structure returned from `read()`.
pub const IN_MODIFY: u32 = 0x00000002;
/// Metadata changed.
///
/// For example, permissions, timestamps, extended attributes, UID, GID, etc.
/// Since Linux 2.6.25, this also includes the link count.
///
/// When monitoring a directory, this event can occur for files in the directory, in which case the `name` field in the returned `inotify_event` from `read()` structure identifies the name of the file within the directory.
///
/// Valid for `inotify_add_watch()`'s `mask` argument.
/// Can be set in the `mask` field of the `inotify_event` structure returned from `read()`.
pub const IN_ATTRIB: u32 = 0x00000004;
/// File opened for writing was closed.
///
/// When monitoring a directory, this event can occur for files in the directory, in which case the `name` field in the returned `inotify_event` from `read()` structure identifies the name of the file within the directory.
///
/// Valid for `inotify_add_watch()`'s `mask` argument.
/// Can be set in the `mask` field of the `inotify_event` structure returned from `read()`.
pub const IN_CLOSE_WRITE: u32 = 0x00000008;
/// File not opened for writing was closed.
///
/// When monitoring a directory, this event can occur for files in the directory, in which case the `name` field in the returned `inotify_event` from `read()` structure identifies the name of the file within the directory.
///
/// Valid for `inotify_add_watch()`'s `mask` argument.
/// Can be set in the `mask` field of the `inotify_event` structure returned from `read()`.
pub const IN_CLOSE_NOWRITE: u32 = 0x00000010;
/// File was opened.
///
/// When monitoring a directory, this event can occur for files in the directory, in which case the `name` field in the returned `inotify_event` from `read()` structure identifies the name of the file within the directory.
///
/// Valid for `inotify_add_watch()`'s `mask` argument.
/// Can be set in the `mask` field of the `inotify_event` structure returned from `read()`.
pub const IN_OPEN: u32 = 0x00000020;
/// File moved out of watched directory.
///
/// When monitoring a directory, this event can occur for files in the directory, in which case the `name` field in the returned `inotify_event` from `read()` structure identifies the name of the file within the directory.
///
/// Valid for `inotify_add_watch()`'s `mask` argument.
/// Can be set in the `mask` field of the `inotify_event` structure returned from `read()`.
pub const IN_MOVED_FROM: u32 = 0x00000040;
/// File moved into watched directory.
///
/// When monitoring a directory, this event can occur for files in the directory, in which case the `name` field in the returned `inotify_event` from `read()` structure identifies the name of the file within the directory.
///
/// Valid for `inotify_add_watch()`'s `mask` argument.
/// Can be set in the `mask` field of the `inotify_event` structure returned from `read()`.
pub const IN_MOVED_TO: u32 = 0x00000080;
/// File/directory created in watched directory.
///
/// When monitoring a directory, this event can occur for files in the directory, in which case the `name` field in the returned `inotify_event` from `read()` structure identifies the name of the file within the directory.
///
/// Valid for `inotify_add_watch()`'s `mask` argument.
/// Can be set in the `mask` field of the `inotify_event` structure returned from `read()`.
pub const IN_CREATE: u32 = 0x00000100;
/// File/directory deleted from watched directory.
///
/// When monitoring a directory, this event can occur for files in the directory, in which case the `name` field in the returned `inotify_event` from `read()` structure identifies the name of the file within the directory.
///
/// Valid for `inotify_add_watch()`'s `mask` argument.
/// Can be set in the `mask` field of the `inotify_event` structure returned from `read()`.
pub const IN_DELETE: u32 = 0x00000200;
/// Watched file/directory was itself deleted.
///
/// Valid for `inotify_add_watch()`'s `mask` argument.
/// Can be set in the `mask` field of the `inotify_event` structure returned from `read()`.
pub const IN_DELETE_SELF: u32 = 0x00000400;
/// Watched file/directory was itself moved.
///
/// Valid for `inotify_add_watch()`'s `mask` argument.
/// Can be set in the `mask` field of the `inotify_event` structure returned from `read()`.
pub const IN_MOVE_SELF: u32 = 0x00000800;
/// This is equivalent to `IN_ACCESS` | `IN_ATTRIB` | `IN_CLOSE_WRITE` | `IN_CLOSE_NOWRITE` | `IN_CREATE` | `IN_DELETE` | `IN_DELETE_SELF` | `IN_MODIFY` | `IN_MOVE_SELF` | `IN_MOVED_FROM` | `IN_MOVED_TO` | `IN_OPEN`.
///
/// Valid for `inotify_add_watch()`'s `mask` argument only.
pub const IN_ALL_EVENTS: u32 = IN_ACCESS | IN_ATTRIB | IN_CLOSE_WRITE | IN_CLOSE_NOWRITE | IN_CREATE | IN_DELETE | IN_DELETE_SELF | IN_MODIFY | IN_MOVE_SELF | IN_MOVED_FROM | IN_MOVED_TO | IN_OPEN;
/// This is equivalent to `IN_MOVED_FROM` | `IN_MOVED_TO`.
///
/// Valid for `inotify_add_watch()`'s `mask` argument only.
pub const IN_MOVE: u32 = IN_MOVED_FROM | IN_MOVED_TO;
/// This is equivalent to `IN_CLOSE_WRITE` | `IN_CLOSE_NOWRITE`.
///
/// Valid for `inotify_add_watch()`'s `mask` argument only.
pub const IN_CLOSE: u32 = IN_CLOSE_WRITE | IN_CLOSE_NOWRITE;
/// Only watch `pathname` if it is a directory.
///
/// Valid for `inotify_add_watch()`'s `mask` argument only.
///
/// Since Linux 2.6.15.
pub const IN_ONLYDIR: u32 = 0x01000000;
/// Don't dereference `pathname` if it is a symbolic link.
///
/// Valid for `inotify_add_watch()`'s `mask` argument only.
///
/// Since Linux 2.6.15.
pub const IN_DONT_FOLLOW: u32 = 0x02000000;
/// By default, when watching events on the children of a directory, events are generated for children even after they have been unlinked from the directory.
///
/// This can result in large numbers of uninteresting events for some applications (eg, if watching `/tmp`, in which many applications create temporary files whose names are immediately unlinked).
/// Specifying `IN_EXCL_UNLINK` changes the default behavior, so that events are not generated for children after they have been unlinked from the watched directory.
///
/// Valid for `inotify_add_watch()`'s `mask` argument only.
///
/// Since Linux 2.6.36.
pub const IN_EXCL_UNLINK: u32 = 0x04000000;
/// Add (`or`) events to watch `mask` for this `pathname` if it already exists (instead of replacing `mask`).
///
/// Valid for `inotify_add_watch()`'s `mask` argument only.
pub const IN_MASK_ADD: u32 = 0x20000000;
/// Monitor `pathname` for one event, then remove from watch list.
///
/// Valid for `inotify_add_watch()`'s `mask` argument only.
pub const IN_ONESHOT: u32 = 0x80000000;
/// File system containing watched object was unmounted.
///
/// Valid only in the `mask` field of the `inotify_event` structure returned from `read()`.
pub const IN_UNMOUNT: u32 = 0x00002000;
/// Event queue overflowed.
///
/// `wd` is `-1` for this event.
///
/// Valid only in the `mask` field of the `inotify_event` structure returned from `read()`.
pub const IN_Q_OVERFLOW: u32 = 0x00004000;
/// Watch was removed.
///
/// This can have been done explicitly using `inotify_rm_watch()` or automatically because the file was deleted, or its file system was unmounted.
///
/// Valid only in the `mask` field of the `inotify_event` structure returned from `read()`.
pub const IN_IGNORED: u32 = 0x00008000;
/// Subject of this event is a directory.
///
/// Valid only in the `mask` field of the `inotify_event` structure returned from `read()`.
pub const IN_ISDIR: u32 = 0x40000000;