Debian Codegraph @

po/ru/man7/inotify.7.po

raw
1 # Russian translation of manpages
2 # This file is distributed under the same license as the manpages-l10n package.
3 # Copyright © of this file:
4 # Azamat Hackimov <[email protected]>, 2013-2014, 2017.
5 # Dmitriy S. Seregin <[email protected]>, 2013.
6 # Yuri Kozlov <[email protected]>, 2011-2019.
7 # Иван Павлов <[email protected]>, 2017, 2019.
8 msgid ""
9 msgstr ""
10 "Project-Id-Version: manpages-l10n\n"
11 "POT-Creation-Date: 2026-06-05 06:27+0200\n"
12 "PO-Revision-Date: 2024-12-21 19:50+0300\n"
13 "Last-Translator: Yuri Kozlov <[email protected]>\n"
14 "Language-Team: Russian <[email protected]>\n"
15 "Language: ru\n"
16 "MIME-Version: 1.0\n"
17 "Content-Type: text/plain; charset=UTF-8\n"
18 "Content-Transfer-Encoding: 8bit\n"
19 "Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
20 "n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || "
21 "(n%100>=11 && n%100<=14)? 2 : 3);\n"
22 "X-Generator: Lokalize 2.0\n"
23
24 #. type: TH
25 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
26 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
27 #, fuzzy, no-wrap
28 #| msgid "inotify events"
29 msgid "inotify"
30 msgstr "События inotify"
31
32 #. type: TH
33 #: archlinux debian-unstable opensuse-leap-16-1 opensuse-tumbleweed
34 #, no-wrap
35 msgid "2026-02-14"
36 msgstr "14 февраля 2026 г."
37
38 #. type: TH
39 #: archlinux debian-unstable
40 #, fuzzy, no-wrap
41 #| msgid "Linux man-pages 6.17"
42 msgid "Linux man-pages 6.18"
43 msgstr "Справочные страницы Linux 6.17"
44
45 #. type: SH
46 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
47 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
48 #, no-wrap
49 msgid "NAME"
50 msgstr "НАИМЕНОВАНИЕ"
51
52 #. type: Plain text
53 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
54 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
55 msgid "inotify - monitoring filesystem events"
56 msgstr "inotify - наблюдает за событиями файловой системы"
57
58 #. type: SH
59 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
60 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
61 #, no-wrap
62 msgid "DESCRIPTION"
63 msgstr "ОПИСАНИЕ"
64
65 #. type: Plain text
66 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
67 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
68 msgid ""
69 "The I<inotify> API provides a mechanism for monitoring filesystem events. "
70 "Inotify can be used to monitor individual files, or to monitor directories. "
71 "When a directory is monitored, inotify will return events for the directory "
72 "itself, and for files inside the directory."
73 msgstr ""
74 "Программный интерфейс I<inotify> предоставляет механизм для слежения за "
75 "событиями в файловой системе. Его можно использовать для слежения за "
76 "отдельными файлами или каталогами. При слежении за каталогами inotify "
77 "возвращает события как для самого каталога, так и для файлов внутри каталога."
78
79 #. type: Plain text
80 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
81 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
82 msgid "The following system calls are used with this API:"
83 msgstr "В программный интерфейс входят следующие системные вызовы:"
84
85 #. type: IP
86 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
87 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
88 #, no-wrap
89 msgid "\\[bu]"
90 msgstr "\\[bu]"
91
92 #. type: Plain text
93 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
94 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
95 msgid ""
96 "B<inotify_init>(2) creates an inotify instance and returns a file "
97 "descriptor referring to the inotify instance. The more recent "
98 "B<inotify_init1>(2) is like B<inotify_init>(2), but has a I<flags> argument "
99 "that provides access to some extra functionality."
100 msgstr ""
101 "Вызов B<inotify_init>(2) создаёт экземпляр inotify и возвращает файловый "
102 "дескриптор, ссылающийся на экземпляр inotify. Более новый "
103 "B<inotify_init1>(2) подобен B<inotify_init>(2), но имеет аргумент I<flags>, "
104 "который предоставляет доступ к некоторым дополнительным возможностям."
105
106 #. type: Plain text
107 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
108 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
109 msgid ""
110 "B<inotify_add_watch>(2) manipulates the \"watch list\" associated with an "
111 "inotify instance. Each item (\"watch\") in the watch list specifies the "
112 "pathname of a file or directory, along with some set of events that the "
113 "kernel should monitor for the file referred to by that pathname. "
114 "B<inotify_add_watch>(2) either creates a new watch item, or modifies an "
115 "existing watch. Each watch has a unique \"watch descriptor\", an integer "
116 "returned by B<inotify_add_watch>(2) when the watch is created."
117 msgstr ""
118 "Вызов B<inotify_add_watch>(2) изменяет «список наблюдения», связанный с "
119 "экземпляром inotify. Каждый элемент (сторожок (watch)) в списке задаёт путь "
120 "к файлу или каталогу и некоторый набор событий, которые ядро должно "
121 "отслеживать для файла, на который указывает этот путь. Вызов "
122 "B<inotify_add_watch>(2) или создаёт новый сторожок, или изменяет "
123 "существующий. Каждый сторожок имеет уникальный «дескриптор сторожка» — целое "
124 "число, возвращаемое B<inotify_add_watch>(2) при создании сторожка."
125
126 #. type: Plain text
127 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
128 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
129 msgid ""
130 "When events occur for monitored files and directories, those events are made "
131 "available to the application as structured data that can be read from the "
132 "inotify file descriptor using B<read>(2) (see below)."
133 msgstr ""
134 "При возникновении событий с отслеживаемыми файлами и каталогами, эти события "
135 "становятся доступны приложению в виде структурированных данных, которые "
136 "можно прочитать из файлового дескриптора inotify с помощью B<read>(2) "
137 "(смотрите ниже)."
138
139 #. type: Plain text
140 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
141 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
142 msgid "B<inotify_rm_watch>(2) removes an item from an inotify watch list."
143 msgstr ""
144 "Вызов B<inotify_rm_watch>(2) удаляет элемент из списка наблюдения inotify."
145
146 #. type: Plain text
147 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
148 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
149 msgid ""
150 "When all file descriptors referring to an inotify instance have been closed "
151 "(using B<close>(2)), the underlying object and its resources are freed for "
152 "reuse by the kernel; all associated watches are automatically freed."
153 msgstr ""
154 "При закрытии (с помощью B<close>(2)) файловых дескрипторов, ссылающихся на "
155 "экземпляр inotify, этот объект и его ресурсы освобождаются для повторного "
156 "использования ядром; все связанные сторожки освобождаются автоматически."
157
158 #. type: Plain text
159 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
160 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
161 msgid ""
162 "With careful programming, an application can use inotify to efficiently "
163 "monitor and cache the state of a set of filesystem objects. However, robust "
164 "applications should allow for the fact that bugs in the monitoring logic or "
165 "races of the kind described below may leave the cache inconsistent with the "
166 "filesystem state. It is probably wise to do some consistency checking, and "
167 "rebuild the cache when inconsistencies are detected."
168 msgstr ""
169 "При корректном программировании, приложение может эффективно использовать "
170 "inotify для слежения и кэширования состояния набора объектов файловой "
171 "системы. Однако, в тщательно проработанных приложениях нужно предполагать "
172 "наличие ошибок в логике слежения или состязательности, описанных далее, "
173 "которые могут приводить к рассогласованности кэша с состоянием файловой "
174 "системы. Вероятно, лучше сделать некоторую проверку и перестроить кэш при "
175 "обнаружении рассогласованности."
176
177 #. type: SS
178 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
179 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
180 #, no-wrap
181 msgid "Reading events from an inotify file descriptor"
182 msgstr "Чтение событий из файлового дескриптора inotify"
183
184 #. type: Plain text
185 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
186 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
187 msgid ""
188 "To determine what events have occurred, an application B<read>(2)s from the "
189 "inotify file descriptor. If no events have so far occurred, then, assuming "
190 "a blocking file descriptor, B<read>(2) will block until at least one event "
191 "occurs (unless interrupted by a signal, in which case the call fails with "
192 "the error B<EINTR>; see B<signal>(7))."
193 msgstr ""
194 "Чтобы определить, что события произошли, приложение должно прочитать "
195 "(B<read>(2)) файловый дескриптор inotify. Если событий не было, то "
196 "предполагая, что это блокирующий файловый дескриптор, вызов B<read>(2) "
197 "заблокирует работу до возникновения, по крайней мере, одного события (если "
198 "не будет прерван сигналом; в этом случае вызов завершается с ошибкой "
199 "B<EINTR>, смотрите B<signal>(7))."
200
201 #. type: Plain text
202 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
203 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
204 msgid ""
205 "Each successful B<read>(2) returns a buffer containing one or more of the "
206 "following structures:"
207 msgstr ""
208 "При успешном выполнении B<read>(2) возвращает буфер с одной или более "
209 "структурами следующего вида:"
210
211 #. FIXME . The type of the 'wd' field should probably be "int32_t".
212 #. I submitted a patch to fix this. See the LKML thread
213 #. "[patch] Fix type errors in inotify interfaces", 18 Nov 2008
214 #. glibc bug filed: https://www.sourceware.org/bugzilla/show_bug.cgi?id=7040
215 #. type: Plain text
216 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
217 #: opensuse-tumbleweed
218 #, fuzzy, no-wrap
219 #| msgid ""
220 #| "struct inotify_event {\n"
221 #| " int wd; /* Watch descriptor */\n"
222 #| " uint32_t mask; /* Mask describing event */\n"
223 #| " uint32_t cookie; /* Unique cookie associating related\n"
224 #| " events (for rename(2)) */\n"
225 #| " uint32_t len; /* Size of I<name> field */\n"
226 #| " char name[]; /* Optional null-terminated name */\n"
227 #| "};\n"
228 msgid ""
229 "struct inotify_event {\n"
230 " int wd; /* Watch descriptor */\n"
231 " uint32_t mask; /* Mask describing event */\n"
232 " uint32_t cookie; /* Unique cookie associating related\n"
233 " events (for rename(2)) */\n"
234 " uint32_t len; /* Size of \\f[I]name\\fR field */\n"
235 " char name[]; /* Optional null-terminated name */\n"
236 "};\n"
237 msgstr ""
238 "struct inotify_event {\n"
239 " int wd; /* дескриптор наблюдаемого */\n"
240 " uint32_t mask; /* маска, описывающая событие */\n"
241 " uint32_t cookie; /* уникальный cookie, связывающий относящиеся\n"
242 " друг к другу события (для rename(2)) */\n"
243 " uint32_t len; /* размер поля I<name> */\n"
244 " char name[]; /* необязательное имя, завершающееся null */\n"
245 "};\n"
246
247 #. type: Plain text
248 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
249 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
250 msgid ""
251 "I<wd> identifies the watch for which this event occurs. It is one of the "
252 "watch descriptors returned by a previous call to B<inotify_add_watch>(2)."
253 msgstr ""
254 "В I<wd> указывается сторожок, к которому относится событие. Это один из "
255 "дескрипторов сторожка, полученный из вызова B<inotify_add_watch>(2)."
256
257 #. type: Plain text
258 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
259 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
260 msgid ""
261 "I<mask> contains bits that describe the event that occurred (see below)."
262 msgstr ""
263 "В I<mask> содержатся биты, описывающие возникшее событие (смотрите ниже)."
264
265 #. type: Plain text
266 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
267 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
268 msgid ""
269 "I<cookie> is a unique integer that connects related events. Currently, this "
270 "is used only for rename events, and allows the resulting pair of "
271 "B<IN_MOVED_FROM> and B<IN_MOVED_TO> events to be connected by the "
272 "application. For all other event types, I<cookie> is set to 0."
273 msgstr ""
274 "Значение I<cookie> — это уникальное целое, которое объединяет связанные "
275 "события. В настоящее время используется только для событий переименования и "
276 "позволяет приложению объединить возвращаемые B<IN_MOVED_FROM> и "
277 "B<IN_MOVED_TO> в пару событий. Для остальных типов событий значение "
278 "I<cookie> равно 0."
279
280 #. type: Plain text
281 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
282 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
283 #, fuzzy
284 #| msgid ""
285 #| "The I<name> field is present only when an event is returned for a file "
286 #| "inside a watched directory; it identifies the filename within to the "
287 #| "watched directory. This filename is null-terminated, and may include "
288 #| "further null bytes (\\(aq\\e0\\(aq) to align subsequent reads to a "
289 #| "suitable address boundary."
290 msgid ""
291 "The I<name> field is present only when an event is returned for a file "
292 "inside a watched directory; it identifies the filename within the watched "
293 "directory. This filename is null-terminated, and may include further null "
294 "bytes (\\[aq]\\[rs]0\\[aq]) to align subsequent reads to a suitable address "
295 "boundary."
296 msgstr ""
297 "Поле I<name> существует только когда событие возвращается для файла внутри "
298 "отслеживаемого каталога; им определяется имя файла внутри отслеживаемого "
299 "каталога. Это имя завершается null и может включать дополнительные байты "
300 "null («\\e0») для выравнивания на подходящую границу адреса при последующих "
301 "операций чтения."
302
303 #. type: Plain text
304 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
305 #: opensuse-leap-16-1 opensuse-tumbleweed
306 #, fuzzy
307 #| msgid ""
308 #| "The I<len> field counts all of the bytes in I<name>, including the null "
309 #| "bytes; the length of each I<inotify_event> structure is thus "
310 #| "I<sizeof(struct inotify_event)+len>."
311 msgid ""
312 "The I<len> field counts all of the bytes in I<name>, including the null "
313 "bytes; the size of each I<inotify_event> structure is thus I<sizeof(struct "
314 "inotify_event)+size>."
315 msgstr ""
316 "Поле I<len> содержит количество всех байт в I<name>, включая байты null; "
317 "длина каждой структуры I<inotify_event> равна I<sizeof(struct inotify_event)"
318 "+len>."
319
320 #. type: Plain text
321 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
322 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
323 #, fuzzy
324 #| msgid ""
325 #| "The behavior when the buffer given to B<read>(2) is too small to return "
326 #| "information about the next event depends on the kernel version: in "
327 #| "kernels before 2.6.21, B<read>(2) returns 0; since kernel 2.6.21, "
328 #| "B<read>(2) fails with the error B<EINVAL>. Specifying a buffer of size"
329 msgid ""
330 "The behavior when the buffer given to B<read>(2) is too small to return "
331 "information about the next event depends on the kernel version: before Linux "
332 "2.6.21, B<read>(2) returns 0; since Linux 2.6.21, B<read>(2) fails with "
333 "the error B<EINVAL>. Specifying a buffer of size"
334 msgstr ""
335 "Если буфер, заданный в B<read>(2), слишком мал для возврата информации о "
336 "следующем событии, то поведение зависит от версии ядра: в ядрах до версии "
337 "2.6.21, B<read>(2) возвращает 0; начиная с версии 2.6.21, B<read>(2) "
338 "завершается с ошибкой B<EINVAL>. Указание размера буфера "
339
340 #. type: Plain text
341 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
342 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
343 #, fuzzy, no-wrap
344 #| msgid " sizeof(struct inotify_event) + NAME_MAX + 1\n"
345 msgid "sizeof(struct inotify_event) + NAME_MAX + 1\n"
346 msgstr " sizeof(struct inotify_event) + NAME_MAX + 1\n"
347
348 #. type: Plain text
349 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
350 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
351 msgid "will be sufficient to read at least one event."
352 msgstr "будет достаточно для чтения, по крайней мере, одного события."
353
354 #. type: SS
355 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
356 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
357 #, no-wrap
358 msgid "inotify events"
359 msgstr "События inotify"
360
361 #. type: Plain text
362 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
363 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
364 msgid ""
365 "The B<inotify_add_watch>(2) I<mask> argument and the I<mask> field of the "
366 "I<inotify_event> structure returned when B<read>(2)ing an inotify file "
367 "descriptor are both bit masks identifying inotify events. The following "
368 "bits can be specified in I<mask> when calling B<inotify_add_watch>(2) and "
369 "may be returned in the I<mask> field returned by B<read>(2):"
370 msgstr ""
371 "В аргументе B<inotify_add_watch>(2) I<mask> и поле I<mask> структуры "
372 "I<inotify_event>, возвращаемых при чтении файлового дескриптора inotify, "
373 "содержатся битовые маски, определяющие события inotify. Следующие биты могут "
374 "быть заданы в I<mask> при вызове B<inotify_add_watch>(2) и возвращены в поле "
375 "I<mask>, возвращаемом B<read>(2):"
376
377 #. type: TP
378 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
379 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
380 #, no-wrap
381 msgid "B<IN_ACCESS> (+)"
382 msgstr "B<IN_ACCESS> (+)"
383
384 #. type: Plain text
385 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
386 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
387 msgid "File was accessed (e.g., B<read>(2), B<execve>(2))."
388 msgstr "Был произведён доступ к файлу (например, B<read>(2), B<execve>(2))."
389
390 #. type: TP
391 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
392 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
393 #, no-wrap
394 msgid "B<IN_ATTRIB> (*)"
395 msgstr "B<IN_ATTRIB> (*)"
396
397 #. #-#-#-#-# archlinux: inotify.7.pot (PACKAGE VERSION) #-#-#-#-#
398 #. FIXME .
399 #. Events do not occur for link count changes on a file inside a monitored
400 #. directory. This differs from other metadata changes for files inside
401 #. a monitored directory.
402 #. type: Plain text
403 #. #-#-#-#-# debian-trixie: inotify.7.pot (PACKAGE VERSION) #-#-#-#-#
404 #. FIXME .
405 #. Events do not occur for link count changes on a file inside a monitored
406 #. directory. This differs from other metadata changes for files inside
407 #. a monitored directory.
408 #. type: Plain text
409 #. #-#-#-#-# debian-unstable: inotify.7.pot (PACKAGE VERSION) #-#-#-#-#
410 #. FIXME .
411 #. Events do not occur for link count changes on a file inside a monitored
412 #. directory. This differs from other metadata changes for files inside
413 #. a monitored directory.
414 #. type: Plain text
415 #. #-#-#-#-# fedora-44: inotify.7.pot (PACKAGE VERSION) #-#-#-#-#
416 #. FIXME .
417 #. Events do not occur for link count changes on a file inside a monitored
418 #. directory. This differs from other metadata changes for files inside
419 #. a monitored directory.
420 #. type: Plain text
421 #. #-#-#-#-# fedora-rawhide: inotify.7.pot (PACKAGE VERSION) #-#-#-#-#
422 #. FIXME .
423 #. Events do not occur for link count changes on a file inside a monitored
424 #. directory. This differs from other metadata changes for files inside
425 #. a monitored directory.
426 #. type: Plain text
427 #. #-#-#-#-# mageia-cauldron: inotify.7.pot (PACKAGE VERSION) #-#-#-#-#
428 #. FIXME .
429 #. Events do not occur for link count changes on a file inside a monitored
430 #. directory. This differs from other metadata changes for files inside
431 #. a monitored directory.
432 #. type: Plain text
433 #. #-#-#-#-# opensuse-leap-16-1: inotify.7.pot (PACKAGE VERSION) #-#-#-#-#
434 #. FIXME .
435 #. Events do not occur for link count changes on a file inside a monitored
436 #. directory. This differs from other metadata changes for files inside
437 #. a monitored directory.
438 #. type: Plain text
439 #. #-#-#-#-# opensuse-tumbleweed: inotify.7.pot (PACKAGE VERSION) #-#-#-#-#
440 #. FIXME .
441 #. Events do not occur for link count changes on a file inside a monitored
442 #. directory. This differs from other metadata changes for files inside
443 #. a monitored directory.
444 #. type: Plain text
445 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
446 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
447 #, fuzzy
448 #| msgid ""
449 #| "Metadata changed\\(emfor example, permissions (e.g., B<chmod>(2)), "
450 #| "timestamps (e.g., B<utimensat>(2)), extended attributes (B<setxattr>(2)), "
451 #| "link count (since Linux 2.6.25; e.g., for the target of B<link>(2) and "
452 #| "for B<unlink>(2)), and user/group ID (e.g., B<chown>(2))."
453 msgid ""
454 "Metadata changed\\[em]for example, permissions (e.g., B<chmod>(2)), "
455 "timestamps (e.g., B<utimensat>(2)), extended attributes (B<setxattr>(2)), "
456 "link count (since Linux 2.6.25; e.g., for the target of B<link>(2) and for "
457 "B<unlink>(2)), and user/group ID (e.g., B<chown>(2))."
458 msgstr ""
459 "Изменились метаданные — например, права доступа (например, B<chmod>(2)), "
460 "отметки времени (например, B<utimensat>(2)), расширенные атрибуты "
461 "(B<setxattr>(2)), счётчик ссылок (начиная с Linux 2.6.25; например, для "
462 "аргумента назначения B<link>(2) и B<unlink>(2)) и идентификатор пользователя/"
463 "группы (например, B<chown>(2))."
464
465 #. type: TP
466 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
467 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
468 #, no-wrap
469 msgid "B<IN_CLOSE_WRITE> (+)"
470 msgstr "B<IN_CLOSE_WRITE> (+)"
471
472 #. type: Plain text
473 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
474 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
475 msgid "File opened for writing was closed."
476 msgstr "Файл, открытый для записи, был закрыт."
477
478 #. type: TP
479 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
480 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
481 #, no-wrap
482 msgid "B<IN_CLOSE_NOWRITE> (*)"
483 msgstr "B<IN_CLOSE_NOWRITE> (*)"
484
485 #. type: Plain text
486 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
487 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
488 msgid "File or directory not opened for writing was closed."
489 msgstr "Файл или каталог, не открытый для записи, был закрыт."
490
491 #. type: TP
492 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
493 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
494 #, no-wrap
495 msgid "B<IN_CREATE> (+)"
496 msgstr "B<IN_CREATE> (+)"
497
498 #. type: Plain text
499 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
500 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
501 msgid ""
502 "File/directory created in watched directory (e.g., B<open>(2) B<O_CREAT>, "
503 "B<mkdir>(2), B<link>(2), B<symlink>(2), B<bind>(2) on a UNIX domain socket)."
504 msgstr ""
505 "В отслеживаемом каталоге был создан файл/каталог (например, B<open>(2) "
506 "B<O_CREAT>, B<mkdir>(2), B<link>(2), B<symlink>(2), B<bind>(2) для доменного "
507 "сокета UNIX)."
508
509 #. type: TP
510 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
511 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
512 #, no-wrap
513 msgid "B<IN_DELETE> (+)"
514 msgstr "B<IN_DELETE> (+)"
515
516 #. type: Plain text
517 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
518 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
519 msgid "File/directory deleted from watched directory."
520 msgstr "В отслеживаемом каталоге был удалён файл/каталог."
521
522 #. type: TP
523 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
524 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
525 #, no-wrap
526 msgid "B<IN_DELETE_SELF>"
527 msgstr "B<IN_DELETE_SELF>"
528
529 #. type: Plain text
530 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
531 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
532 msgid ""
533 "Watched file/directory was itself deleted. (This event also occurs if an "
534 "object is moved to another filesystem, since B<mv>(1) in effect copies the "
535 "file to the other filesystem and then deletes it from the original "
536 "filesystem.) In addition, an B<IN_IGNORED> event will subsequently be "
537 "generated for the watch descriptor."
538 msgstr ""
539 "Отслеживаемый файл/каталог был удалён (это событие также возникает, если "
540 "объект перемещён в другую файловую систему, так как B<mv>(1), фактически, "
541 "копирует файл в другую файловую систему и удаляет его из исходной). Также "
542 "затем будет создано событие B<IN_IGNORED> для дескриптора сторожка."
543
544 #. type: TP
545 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
546 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
547 #, no-wrap
548 msgid "B<IN_MODIFY> (+)"
549 msgstr "B<IN_MODIFY> (+)"
550
551 #. type: Plain text
552 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
553 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
554 msgid "File was modified (e.g., B<write>(2), B<truncate>(2))."
555 msgstr "Файл был изменён (например, B<write>(2), B<truncate>(2))."
556
557 #. type: TP
558 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
559 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
560 #, no-wrap
561 msgid "B<IN_MOVE_SELF>"
562 msgstr "B<IN_MOVE_SELF>"
563
564 #. type: Plain text
565 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
566 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
567 msgid "Watched file/directory was itself moved."
568 msgstr "Отслеживаемый файл/каталог был перемещён."
569
570 #. type: TP
571 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
572 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
573 #, no-wrap
574 msgid "B<IN_MOVED_FROM> (+)"
575 msgstr "B<IN_MOVED_FROM> (+)"
576
577 #. type: Plain text
578 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
579 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
580 msgid ""
581 "Generated for the directory containing the old filename when a file is "
582 "renamed."
583 msgstr ""
584 "При переименовании генерируется для каталога, содержащего старое имя файла."
585
586 #. type: TP
587 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
588 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
589 #, no-wrap
590 msgid "B<IN_MOVED_TO> (+)"
591 msgstr "B<IN_MOVED_TO> (+)"
592
593 #. type: Plain text
594 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
595 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
596 msgid ""
597 "Generated for the directory containing the new filename when a file is "
598 "renamed."
599 msgstr ""
600 "При переименовании генерируется для каталога, содержащего новое имя файла."
601
602 #. type: TP
603 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
604 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
605 #, no-wrap
606 msgid "B<IN_OPEN> (*)"
607 msgstr "B<IN_OPEN> (*)"
608
609 #. type: Plain text
610 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
611 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
612 msgid "File or directory was opened."
613 msgstr "Файл или каталог был открыт."
614
615 #. type: Plain text
616 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
617 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
618 msgid ""
619 "Inotify monitoring is inode-based: when monitoring a file (but not when "
620 "monitoring the directory containing a file), an event can be generated for "
621 "activity on any link to the file (in the same or a different directory)."
622 msgstr ""
623 "Наблюдение inotify ведётся за inode: при наблюдении за файлом (но не когда "
624 "наблюдение ведётся за каталогом, содержащим файл) событие может "
625 "генерироваться при активности по любой ссылке на файл (находящейся в том же "
626 "или в другом каталоге)."
627
628 #. type: Plain text
629 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
630 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
631 msgid "When monitoring a directory:"
632 msgstr "При наблюдении за каталогом:"
633
634 #. type: Plain text
635 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
636 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
637 msgid ""
638 "the events marked above with an asterisk (*) can occur both for the "
639 "directory itself and for objects inside the directory; and"
640 msgstr ""
641 "события, помеченные звёздочкой (*), могут возникать как для самого каталога, "
642 "так и для файлов в каталоге; и"
643
644 #. type: Plain text
645 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
646 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
647 msgid ""
648 "the events marked with a plus sign (+) occur only for objects inside the "
649 "directory (not for the directory itself)."
650 msgstr ""
651 "события, помеченные знаком плюс (+), могут возникать только для объектов "
652 "внутри каталога (но не самого каталога)."
653
654 #. type: Plain text
655 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
656 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
657 msgid ""
658 "I<Note>: when monitoring a directory, events are not generated for the files "
659 "inside the directory when the events are performed via a pathname (i.e., a "
660 "link) that lies outside the monitored directory."
661 msgstr ""
662 "I<Замечание>: при слежении за каталогом события не генерируются для файлов "
663 "каталога, если событие возникает по пути (т. е., по ссылке), который "
664 "находится вне отслеживаемого каталога."
665
666 #. type: Plain text
667 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
668 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
669 msgid ""
670 "When events are generated for objects inside a watched directory, the "
671 "I<name> field in the returned I<inotify_event> structure identifies the name "
672 "of the file within the directory."
673 msgstr ""
674 "Когда события генерируются для объектов внутри отслеживаемого каталога, поле "
675 "I<name>, возвращаемое в структуре I<inotify_event>, хранит имя файла внутри "
676 "этого каталога."
677
678 #. type: Plain text
679 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
680 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
681 msgid ""
682 "The B<IN_ALL_EVENTS> macro is defined as a bit mask of all of the above "
683 "events. This macro can be used as the I<mask> argument when calling "
684 "B<inotify_add_watch>(2)."
685 msgstr ""
686 "Макрос B<IN_ALL_EVENTS> определён как битовая маска всех перечисленных выше "
687 "событий. Данный макрос можно использовать в качестве аргумента I<mask> в "
688 "вызове B<inotify_add_watch>(2)."
689
690 #. type: Plain text
691 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
692 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
693 msgid "Two additional convenience macros are defined:"
694 msgstr "Дополнительно, два удобных макроса:"
695
696 #. type: TP
697 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
698 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
699 #, no-wrap
700 msgid "B<IN_MOVE>"
701 msgstr "B<IN_MOVE>"
702
703 #. type: Plain text
704 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
705 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
706 msgid "Equates to B<IN_MOVED_FROM | IN_MOVED_TO>."
707 msgstr "То же, что и B<IN_MOVED_FROM | IN_MOVED_TO>."
708
709 #. type: TP
710 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
711 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
712 #, no-wrap
713 msgid "B<IN_CLOSE>"
714 msgstr "B<IN_CLOSE>"
715
716 #. type: Plain text
717 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
718 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
719 msgid "Equates to B<IN_CLOSE_WRITE | IN_CLOSE_NOWRITE>."
720 msgstr "То же, что и B<IN_CLOSE_WRITE | IN_CLOSE_NOWRITE>."
721
722 #. type: Plain text
723 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
724 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
725 msgid ""
726 "The following further bits can be specified in I<mask> when calling "
727 "B<inotify_add_watch>(2):"
728 msgstr ""
729 "Также, при вызове B<inotify_add_watch>(2) в I<mask> могут быть указаны "
730 "следующие биты:"
731
732 #. type: TP
733 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
734 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
735 #, no-wrap
736 msgid "B<IN_DONT_FOLLOW> (since Linux 2.6.15)"
737 msgstr "B<IN_DONT_FOLLOW> (начиная с Linux 2.6.15)"
738
739 #. type: Plain text
740 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
741 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
742 msgid "Don't dereference I<pathname> if it is a symbolic link."
743 msgstr "Не разыменовывать I<pathname>, если это символическая ссылка."
744
745 #. type: TP
746 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
747 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
748 #, no-wrap
749 msgid "B<IN_EXCL_UNLINK> (since Linux 2.6.36)"
750 msgstr "B<IN_EXCL_UNLINK> (начиная с Linux 2.6.36)"
751
752 #. commit 8c1934c8d70b22ca8333b216aec6c7d09fdbd6a6
753 #. type: Plain text
754 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
755 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
756 msgid ""
757 "By default, when watching events on the children of a directory, events are "
758 "generated for children even after they have been unlinked from the "
759 "directory. This can result in large numbers of uninteresting events for "
760 "some applications (e.g., if watching I</tmp>, in which many applications "
761 "create temporary files whose names are immediately unlinked). Specifying "
762 "B<IN_EXCL_UNLINK> changes the default behavior, so that events are not "
763 "generated for children after they have been unlinked from the watched "
764 "directory."
765 msgstr ""
766 "По умолчанию, при слежении за событиями для потомков каталога, события "
767 "генерируются для потомков даже после того, как они будут удалены из "
768 "каталога. Это может привести к большому количеству ненужных для приложения "
769 "событий (например, если следить за I</tmp>, в котором многие приложения "
770 "создают и сразу удаляют временные файлы). Указание B<IN_EXCL_UNLINK> "
771 "изменяет поведение по умолчанию, и такие события не генерируются для "
772 "потомков после удаления из отслеживаемого каталога."
773
774 #. type: TP
775 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
776 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
777 #, no-wrap
778 msgid "B<IN_MASK_ADD>"
779 msgstr "B<IN_MASK_ADD>"
780
781 #. type: Plain text
782 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
783 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
784 msgid ""
785 "If a watch instance already exists for the filesystem object corresponding "
786 "to I<pathname>, add (OR) the events in I<mask> to the watch mask (instead of "
787 "replacing the mask); the error B<EINVAL> results if B<IN_MASK_CREATE> is "
788 "also specified."
789 msgstr ""
790 "Если экземпляр слежения уже существует для объекта файловой системы "
791 "соответствующего I<pathname>, то выполнять добавление (OR) событий в I<mask> "
792 "к маске слежения (вместо замены маски); если также указан B<IN_MASK_CREATE>, "
793 "то возвращается ошибка B<EINVAL>."
794
795 #. type: TP
796 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
797 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
798 #, no-wrap
799 msgid "B<IN_ONESHOT>"
800 msgstr "B<IN_ONESHOT>"
801
802 #. type: Plain text
803 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
804 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
805 msgid ""
806 "Monitor the filesystem object corresponding to I<pathname> for one event, "
807 "then remove from watch list."
808 msgstr ""
809 "Отслеживать объект файловой системы, соответствующий I<pathname> до одного "
810 "события, затем удалить объект из списка слежения."
811
812 #. type: TP
813 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
814 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
815 #, no-wrap
816 msgid "B<IN_ONLYDIR> (since Linux 2.6.15)"
817 msgstr "B<IN_ONLYDIR> (начиная с Linux 2.6.15)"
818
819 #. type: Plain text
820 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
821 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
822 msgid ""
823 "Watch I<pathname> only if it is a directory; the error B<ENOTDIR> results if "
824 "I<pathname> is not a directory. Using this flag provides an application "
825 "with a race-free way of ensuring that the monitored object is a directory."
826 msgstr ""
827 "Следить за I<pathname>, только если это каталог; если I<pathname> не "
828 "является каталогом, то возвращается ошибка B<ENOTDIR>. Этот флаг "
829 "предоставляет приложению бессостязательный способ убедиться, что "
830 "отслеживаемый объект — каталог."
831
832 #. type: TP
833 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
834 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
835 #, no-wrap
836 msgid "B<IN_MASK_CREATE> (since Linux 4.18)"
837 msgstr "B<IN_MASK_CREATE> (начиная с Linux 4.18)"
838
839 #. type: Plain text
840 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
841 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
842 msgid ""
843 "Watch I<pathname> only if it does not already have a watch associated with "
844 "it; the error B<EEXIST> results if I<pathname> is already being watched."
845 msgstr ""
846 "Следить за I<pathname> только, если за ним никто не следит; если уже "
847 "выполняется слежение за I<pathname>, то возвращается ошибка B<EEXIST>."
848
849 #. type: Plain text
850 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
851 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
852 msgid ""
853 "Using this flag provides an application with a way of ensuring that new "
854 "watches do not modify existing ones. This is useful because multiple paths "
855 "may refer to the same inode, and multiple calls to B<inotify_add_watch>(2) "
856 "without this flag may clobber existing watch masks."
857 msgstr ""
858 "С помощью этого флага приложение может быть уверено, что новые слежения не "
859 "изменят существующих. Это полезно, так как несколько путей могут ссылаться "
860 "на одну иноду, а несколько вызовов B<inotify_add_watch>(2) без этого флага "
861 "могут затереть существующие маски слежения."
862
863 #. type: Plain text
864 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
865 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
866 msgid ""
867 "The following bits may be set in the I<mask> field returned by B<read>(2):"
868 msgstr ""
869 "Следующие биты могут быть установлены в поле I<mask> при возврате из "
870 "B<read>(2):"
871
872 #. type: TP
873 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
874 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
875 #, no-wrap
876 msgid "B<IN_IGNORED>"
877 msgstr "B<IN_IGNORED>"
878
879 #. type: Plain text
880 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
881 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
882 msgid ""
883 "Watch was removed explicitly (B<inotify_rm_watch>(2)) or automatically "
884 "(file was deleted, or filesystem was unmounted). See also BUGS."
885 msgstr ""
886 "Слежение было снято явно (B<inotify_rm_watch>(2)) или автоматически (файл "
887 "был удалён или размонтирована файловая система). Также смотрите ДЕФЕКТЫ."
888
889 #. type: TP
890 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
891 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
892 #, no-wrap
893 msgid "B<IN_ISDIR>"
894 msgstr "B<IN_ISDIR>"
895
896 #. type: Plain text
897 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
898 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
899 msgid "Subject of this event is a directory."
900 msgstr "Объект этого события — каталог."
901
902 #. type: TP
903 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
904 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
905 #, no-wrap
906 msgid "B<IN_Q_OVERFLOW>"
907 msgstr "B<IN_Q_OVERFLOW>"
908
909 #. type: Plain text
910 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
911 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
912 msgid "Event queue overflowed (I<wd> is -1 for this event)."
913 msgstr ""
914 "Переполнена очередь событий (для этого события значение I<wd> равно -1)."
915
916 #. type: TP
917 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
918 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
919 #, no-wrap
920 msgid "B<IN_UNMOUNT>"
921 msgstr "B<IN_UNMOUNT>"
922
923 #. type: Plain text
924 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
925 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
926 msgid ""
927 "Filesystem containing watched object was unmounted. In addition, an "
928 "B<IN_IGNORED> event will subsequently be generated for the watch descriptor."
929 msgstr ""
930 "Файловая система, содержащая отслеживаемый объект, была размонтирована. "
931 "Также, будет сгенерировано событие B<IN_IGNORED> для дескриптора сторожка."
932
933 #. type: SS
934 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
935 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
936 #, no-wrap
937 msgid "Examples"
938 msgstr "Примеры"
939
940 #. type: Plain text
941 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
942 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
943 msgid ""
944 "Suppose an application is watching the directory I<dir> and the file I<dir/"
945 "myfile> for all events. The examples below show some events that will be "
946 "generated for these two objects."
947 msgstr ""
948 "Предположим, приложение следит за всеми событиями для каталога I<dir> и "
949 "файла I<dir/myfile>. В примере ниже показаны некоторые события, которые "
950 "будут сгенерированы для этих двух объектов."
951
952 #. type: TP
953 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
954 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
955 #, no-wrap
956 msgid "fd = open(\"dir/myfile\", O_RDWR);"
957 msgstr "fd = open(\"dir/myfile\", O_RDWR);"
958
959 #. type: Plain text
960 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
961 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
962 msgid "Generates B<IN_OPEN> events for both I<dir> and I<dir/myfile>."
963 msgstr "Генерируется событие B<IN_OPEN> и для I<dir>, и для I<dir/myfile>."
964
965 #. type: TP
966 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
967 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
968 #, no-wrap
969 msgid "read(fd, buf, count);"
970 msgstr "read(fd, buf, count);"
971
972 #. type: Plain text
973 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
974 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
975 msgid "Generates B<IN_ACCESS> events for both I<dir> and I<dir/myfile>."
976 msgstr "Генерируется событие B<IN_ACCESS> и для I<dir>, и для I<dir/myfile>."
977
978 #. type: TP
979 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
980 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
981 #, no-wrap
982 msgid "write(fd, buf, count);"
983 msgstr "write(fd, buf, count);"
984
985 #. type: Plain text
986 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
987 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
988 msgid "Generates B<IN_MODIFY> events for both I<dir> and I<dir/myfile>."
989 msgstr "Генерируется событие B<IN_MODIFY> и для I<dir>, и для I<dir/myfile>."
990
991 #. type: TP
992 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
993 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
994 #, no-wrap
995 msgid "fchmod(fd, mode);"
996 msgstr "fchmod(fd, mode);"
997
998 #. type: Plain text
999 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1000 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1001 msgid "Generates B<IN_ATTRIB> events for both I<dir> and I<dir/myfile>."
1002 msgstr "Генерируется событие B<IN_ATTRIB> и для I<dir>, и для I<dir/myfile>."
1003
1004 #. type: TP
1005 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1006 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1007 #, no-wrap
1008 msgid "close(fd);"
1009 msgstr "close(fd);"
1010
1011 #. type: Plain text
1012 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1013 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1014 msgid "Generates B<IN_CLOSE_WRITE> events for both I<dir> and I<dir/myfile>."
1015 msgstr ""
1016 "Генерируется событие B<IN_CLOSE_WRITE> и для I<dir>, и для I<dir/myfile>."
1017
1018 #. type: Plain text
1019 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1020 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1021 msgid ""
1022 "Suppose an application is watching the directories I<dir1> and I<dir2>, and "
1023 "the file I<dir1/myfile>. The following examples show some events that may "
1024 "be generated."
1025 msgstr ""
1026 "Предположим, приложение следит за всеми событиями для каталогов I<dir1> и "
1027 "I<dir2> и файла I<dir1/myfile>. В примере ниже показаны некоторые события, "
1028 "которые могут быть сгенерированы."
1029
1030 #. type: TP
1031 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1032 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1033 #, no-wrap
1034 msgid "link(\"dir1/myfile\", \"dir2/new\");"
1035 msgstr "link(\"dir1/myfile\", \"dir2/new\");"
1036
1037 #. type: Plain text
1038 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1039 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1040 msgid ""
1041 "Generates an B<IN_ATTRIB> event for I<myfile> and an B<IN_CREATE> event for "
1042 "I<dir2>."
1043 msgstr ""
1044 "Генерируется событие B<IN_ATTRIB> для I<myfile> и событие B<IN_CREATE> для "
1045 "I<dir2>."
1046
1047 #. type: TP
1048 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1049 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1050 #, no-wrap
1051 msgid "rename(\"dir1/myfile\", \"dir2/myfile\");"
1052 msgstr "rename(\"dir1/myfile\", \"dir2/myfile\");"
1053
1054 #. type: Plain text
1055 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1056 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1057 msgid ""
1058 "Generates an B<IN_MOVED_FROM> event for I<dir1>, an B<IN_MOVED_TO> event for "
1059 "I<dir2>, and an B<IN_MOVE_SELF> event for I<myfile>. The B<IN_MOVED_FROM> "
1060 "and B<IN_MOVED_TO> events will have the same I<cookie> value."
1061 msgstr ""
1062 "Генерируется событие B<IN_MOVED_FROM> для I<dir1>, событие B<IN_MOVED_TO> "
1063 "для I<dir2> и событие B<IN_MOVE_SELF> для I<myfile>. События "
1064 "B<IN_MOVED_FROM> и B<IN_MOVED_TO> будут содержать одинаковое значение "
1065 "I<cookie>."
1066
1067 #. type: Plain text
1068 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1069 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1070 msgid ""
1071 "Suppose that I<dir1/xx> and I<dir2/yy> are (the only) links to the same "
1072 "file, and an application is watching I<dir1>, I<dir2>, I<dir1/xx>, and "
1073 "I<dir2/yy>. Executing the following calls in the order given below will "
1074 "generate the following events:"
1075 msgstr ""
1076 "Предположим, что I<dir1/xx> и I<dir2/yy> только ссылки на один файл и "
1077 "приложение следит за I<dir1>, I<dir2>, I<dir1/xx> и I<dir2/yy>. При "
1078 "выполнение следующих вызовов в порядке, указанном ниже, будут сгенерированы "
1079 "следующие события:"
1080
1081 #. type: TP
1082 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1083 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1084 #, no-wrap
1085 msgid "unlink(\"dir2/yy\");"
1086 msgstr "unlink(\"dir2/yy\");"
1087
1088 #. type: Plain text
1089 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1090 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1091 msgid ""
1092 "Generates an B<IN_ATTRIB> event for I<xx> (because its link count changes) "
1093 "and an B<IN_DELETE> event for I<dir2>."
1094 msgstr ""
1095 "Генерируется событие B<IN_ATTRIB> для I<xx> (так как изменился его счётчик "
1096 "ссылок) и событие B<IN_DELETE> для I<dir2>."
1097
1098 #. type: TP
1099 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1100 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1101 #, no-wrap
1102 msgid "unlink(\"dir1/xx\");"
1103 msgstr "unlink(\"dir1/xx\");"
1104
1105 #. type: Plain text
1106 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1107 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1108 msgid ""
1109 "Generates B<IN_ATTRIB>, B<IN_DELETE_SELF>, and B<IN_IGNORED> events for "
1110 "I<xx>, and an B<IN_DELETE> event for I<dir1>."
1111 msgstr ""
1112 "Генерируется событие B<IN_ATTRIB>, B<IN_DELETE_SELF> и B<IN_IGNORED> для "
1113 "I<xx> и событие B<IN_DELETE> для I<dir1>."
1114
1115 #. type: Plain text
1116 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1117 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1118 msgid ""
1119 "Suppose an application is watching the directory I<dir> and (the empty) "
1120 "directory I<dir/subdir>. The following examples show some events that may "
1121 "be generated."
1122 msgstr ""
1123 "Предположим, приложение следит за каталогом I<dir> и пустым каталогом I<dir/"
1124 "subdir>. В примере ниже показаны некоторые события, которые могут быть "
1125 "сгенерированы."
1126
1127 #. type: TP
1128 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1129 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1130 #, no-wrap
1131 msgid "mkdir(\"dir/new\", mode);"
1132 msgstr "mkdir(\"dir/new\", mode);"
1133
1134 #. type: Plain text
1135 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1136 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1137 msgid "Generates an B<IN_CREATE | IN_ISDIR> event for I<dir>."
1138 msgstr "Генерируется событие B<IN_CREATE | IN_ISDIR> для I<dir>."
1139
1140 #. type: TP
1141 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1142 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1143 #, no-wrap
1144 msgid "rmdir(\"dir/subdir\");"
1145 msgstr "rmdir(\"dir/subdir\");"
1146
1147 #. type: Plain text
1148 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1149 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1150 msgid ""
1151 "Generates B<IN_DELETE_SELF> and B<IN_IGNORED> events for I<subdir>, and an "
1152 "B<IN_DELETE | IN_ISDIR> event for I<dir>."
1153 msgstr ""
1154 "Генерируются события B<IN_DELETE_SELF> и B<IN_IGNORED> для I<subdir> и "
1155 "событие B<IN_DELETE | IN_ISDIR> для I<dir>."
1156
1157 #. type: SS
1158 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1159 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1160 #, no-wrap
1161 msgid "/proc interfaces"
1162 msgstr "Интерфейс /proc"
1163
1164 #. type: Plain text
1165 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1166 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1167 msgid ""
1168 "The following interfaces can be used to limit the amount of kernel memory "
1169 "consumed by inotify:"
1170 msgstr ""
1171 "Для ограничения потребления inotify памяти ядра, можно использовать "
1172 "следующие интерфейсы:"
1173
1174 #. type: TP
1175 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1176 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1177 #, no-wrap
1178 msgid "I</proc/sys/fs/inotify/max_queued_events>"
1179 msgstr "I</proc/sys/fs/inotify/max_queued_events>"
1180
1181 #. type: Plain text
1182 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1183 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1184 msgid ""
1185 "The value in this file is used when an application calls B<inotify_init>(2) "
1186 "to set an upper limit on the number of events that can be queued to the "
1187 "corresponding inotify instance. Events in excess of this limit are dropped, "
1188 "but an B<IN_Q_OVERFLOW> event is always generated."
1189 msgstr ""
1190 "Значение в этом файле используется когда приложение вызывает "
1191 "B<inotify_init>(2) для установки верхнего порога количества событий, которые "
1192 "могут поместиться в очередь соответствующего экземпляра inotify. События, "
1193 "превысившие это ограничение, отбрасываются, но событие B<IN_Q_OVERFLOW> "
1194 "генерируется всегда."
1195
1196 #. type: TP
1197 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1198 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1199 #, no-wrap
1200 msgid "I</proc/sys/fs/inotify/max_user_instances>"
1201 msgstr "I</proc/sys/fs/inotify/max_user_instances>"
1202
1203 #. type: Plain text
1204 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1205 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1206 msgid ""
1207 "This specifies an upper limit on the number of inotify instances that can be "
1208 "created per real user ID."
1209 msgstr ""
1210 "В этом файле задаётся ограничение на количество экземпляров inotify, которые "
1211 "могут быть созданы для одного реального идентификатора пользователя."
1212
1213 #. type: TP
1214 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1215 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1216 #, no-wrap
1217 msgid "I</proc/sys/fs/inotify/max_user_watches>"
1218 msgstr "I</proc/sys/fs/inotify/max_user_watches>"
1219
1220 #. type: Plain text
1221 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1222 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1223 msgid ""
1224 "This specifies an upper limit on the number of watches that can be created "
1225 "per real user ID."
1226 msgstr ""
1227 "В этом файле задаётся ограничение на количество сторожков, которые могут "
1228 "быть созданы для одного реального идентификатора пользователя."
1229
1230 #. type: SH
1231 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1232 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1233 #, no-wrap
1234 msgid "STANDARDS"
1235 msgstr "СТАНДАРТЫ"
1236
1237 #. type: Plain text
1238 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1239 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1240 msgid "Linux."
1241 msgstr "Linux."
1242
1243 #. type: SH
1244 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1245 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1246 #, no-wrap
1247 msgid "HISTORY"
1248 msgstr "ИСТОРИЯ"
1249
1250 #. type: Plain text
1251 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1252 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1253 #, fuzzy
1254 #| msgid ""
1255 #| "Inotify was merged into the 2.6.13 Linux kernel. The required library "
1256 #| "interfaces were added to glibc in version 2.4. (B<IN_DONT_FOLLOW>, "
1257 #| "B<IN_MASK_ADD>, and B<IN_ONLYDIR> were added in glibc version 2.5.)"
1258 msgid ""
1259 "Inotify was merged into Linux 2.6.13. The required library interfaces were "
1260 "added in glibc 2.4. (B<IN_DONT_FOLLOW>, B<IN_MASK_ADD>, and B<IN_ONLYDIR> "
1261 "were added in glibc 2.5.)"
1262 msgstr ""
1263 "Программный интерфейс inotify был добавлен в ядро Linux версии 2.6.13. "
1264 "Необходимые библиотечные интерфейсы добавлены в glibc версии 2.4 "
1265 "(B<IN_DONT_FOLLOW>, B<IN_MASK_ADD> и B<IN_ONLYDIR> добавлены в glibc версии "
1266 "2.5)."
1267
1268 #. type: SH
1269 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1270 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1271 #, no-wrap
1272 msgid "NOTES"
1273 msgstr "ПРИМЕЧАНИЯ"
1274
1275 #. type: Plain text
1276 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1277 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1278 msgid ""
1279 "Inotify file descriptors can be monitored using B<select>(2), B<poll>(2), "
1280 "and B<epoll>(7). When an event is available, the file descriptor indicates "
1281 "as readable."
1282 msgstr ""
1283 "За файловыми дескрипторами inotify можно наблюдать с помощью B<select>(2), "
1284 "B<poll>(2), и B<epoll>(7). Когда возникает событие, файловый дескриптор "
1285 "указывает на возможность чтения."
1286
1287 #. type: Plain text
1288 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1289 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1290 msgid ""
1291 "Since Linux 2.6.25, signal-driven I/O notification is available for inotify "
1292 "file descriptors; see the discussion of B<F_SETFL> (for setting the "
1293 "B<O_ASYNC> flag), B<F_SETOWN>, and B<F_SETSIG> in B<fcntl>(2). The "
1294 "I<siginfo_t> structure (described in B<sigaction>(2)) that is passed to the "
1295 "signal handler has the following fields set: I<si_fd> is set to the inotify "
1296 "file descriptor number; I<si_signo> is set to the signal number; I<si_code> "
1297 "is set to B<POLL_IN>; and B<POLLIN> is set in I<si_band>."
1298 msgstr ""
1299 "Начиная с Linux 2.6.25, для файловых дескрипторов inotify стали доступны "
1300 "уведомления ввода-вывода посредством сигналов; смотрите обсуждение "
1301 "B<F_SETFL> (для установки флага B<O_ASYNC>), B<F_SETOWN> и B<F_SETSIG> в "
1302 "B<fcntl>(2). Структура I<siginfo_t> (описана в B<sigaction>(2)), "
1303 "передаваемая обработчику сигнала, содержит следующие настройки полей: в "
1304 "I<si_fd> указывается номер файлового дескриптора inotify; в I<si_signo> "
1305 "указывается номер сигнала; в I<si_code> указывается B<POLL_IN>; в I<si_band> "
1306 "указывается B<POLLIN>."
1307
1308 #. type: Plain text
1309 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1310 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1311 msgid ""
1312 "If successive output inotify events produced on the inotify file descriptor "
1313 "are identical (same I<wd>, I<mask>, I<cookie>, and I<name>), then they are "
1314 "coalesced into a single event if the older event has not yet been read (but "
1315 "see BUGS). This reduces the amount of kernel memory required for the event "
1316 "queue, but also means that an application can't use inotify to reliably "
1317 "count file events."
1318 msgstr ""
1319 "Если последующие события inotify, выводимые в файловый дескриптор inotify, "
1320 "одинаковы (содержат одинаковые значения I<wd>, I<mask>, I<cookie> и "
1321 "I<name>), то они сливаются в одно событие, если самое старое событие ещё не "
1322 "прочитано (но смотрите ДЕФЕКТЫ). Это сокращает требуемое количество памяти "
1323 "ядра для очереди событий, но также означает, что приложение не может "
1324 "использовать inotify для надёжного подсчёта файловых событий."
1325
1326 #. type: Plain text
1327 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1328 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1329 msgid ""
1330 "The events returned by reading from an inotify file descriptor form an "
1331 "ordered queue. Thus, for example, it is guaranteed that when renaming from "
1332 "one directory to another, events will be produced in the correct order on "
1333 "the inotify file descriptor."
1334 msgstr ""
1335 "События, возвращаемые при чтении из файлового дескриптора inotify, формируют "
1336 "упорядоченную очередь. То есть, например, это гарантирует, что при "
1337 "переименовании одного каталога в другой, события в файловом дескрипторе "
1338 "inotify будут созданы в правильном порядке."
1339
1340 #. type: Plain text
1341 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1342 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1343 #, fuzzy
1344 #| msgid ""
1345 #| "The set of watch descriptors that is being monitored via an inotify file "
1346 #| "descriptor can be viewed via the entry for the inotify file descriptor in "
1347 #| "the process's I</proc/[pid]/fdinfo> directory. See B<proc>(5) for "
1348 #| "further details. The B<FIONREAD> B<ioctl>(2) returns the number of "
1349 #| "bytes available to read from an inotify file descriptor."
1350 msgid ""
1351 "The set of watch descriptors that is being monitored via an inotify file "
1352 "descriptor can be viewed via the entry for the inotify file descriptor in "
1353 "the process's I</proc/>pidI</fdinfo> directory. See B<proc>(5) for further "
1354 "details. The B<FIONREAD> B<ioctl>(2) returns the number of bytes available "
1355 "to read from an inotify file descriptor."
1356 msgstr ""
1357 "Набор наблюдаемых дескрипторов, которые отслеживаются через файловый "
1358 "дескриптор inotify, можно увидеть из записи для файлового дескриптора "
1359 "inotify в каталоге процесса I</proc/[pid]/fdinfo>. Дополнительную информацию "
1360 "смотрите в B<proc>(5). Вызов B<FIONREAD> B<ioctl>(2) возвращает количество "
1361 "байт, доступных для чтения из файлового дескриптора inotify."
1362
1363 #. type: SS
1364 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1365 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1366 #, no-wrap
1367 msgid "Limitations and caveats"
1368 msgstr "Ограничения и подводные камни"
1369
1370 #. type: Plain text
1371 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1372 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1373 msgid ""
1374 "The inotify API provides no information about the user or process that "
1375 "triggered the inotify event. In particular, there is no easy way for a "
1376 "process that is monitoring events via inotify to distinguish events that it "
1377 "triggers itself from those that are triggered by other processes."
1378 msgstr ""
1379 "Программный интерфейс inotify не предоставляет информацию о пользователе или "
1380 "процессе, из-за которого возникло событие. В частности, для процесса, "
1381 "отслеживающего события через inotify, нет простого способа определить, "
1382 "возникли события из-за его действий или из-за действий других процессов."
1383
1384 #. type: Plain text
1385 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1386 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1387 msgid ""
1388 "Inotify reports only events that a user-space program triggers through the "
1389 "filesystem API. As a result, it does not catch remote events that occur on "
1390 "network filesystems. (Applications must fall back to polling the filesystem "
1391 "to catch such events.) Furthermore, various pseudo-filesystems such as I</"
1392 "proc>, I</sys>, and I</dev/pts> are not monitorable with inotify."
1393 msgstr ""
1394 "Inotify сообщает только о событиях, которые возникли из-за пользовательских "
1395 "программ, использовавших программный интерфейс файловой системы. То есть, не "
1396 "возникает событий для файловых систем, доступных по сети (приложения должны "
1397 "использовать старый метод опроса файловой системы для слежения за такими "
1398 "событиями). Кроме того, различные псевдо-файловый системы, такие как I</"
1399 "proc>, I</sys> и I</dev/pts>, не отслеживаются через inotify."
1400
1401 #. type: Plain text
1402 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1403 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1404 msgid ""
1405 "The inotify API does not report file accesses and modifications that may "
1406 "occur because of B<mmap>(2), B<msync>(2), and B<munmap>(2)."
1407 msgstr ""
1408 "Программный интерфейс inotify не сообщает о доступе и изменениях, которые "
1409 "могут произойти из-за B<mmap>(2), B<msync>(2) и B<munmap>(2)."
1410
1411 #. type: Plain text
1412 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1413 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1414 msgid ""
1415 "The inotify API identifies affected files by filename. However, by the time "
1416 "an application processes an inotify event, the filename may already have "
1417 "been deleted or renamed."
1418 msgstr ""
1419 "Программный интерфейс inotify в качестве идентификаторов объектов использует "
1420 "имена файлов. Однако, в момент обработки приложением события inotify, имя "
1421 "файла может быть уже удалено или переименовано."
1422
1423 #. type: Plain text
1424 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1425 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1426 msgid ""
1427 "The inotify API identifies events via watch descriptors. It is the "
1428 "application's responsibility to cache a mapping (if one is needed) between "
1429 "watch descriptors and pathnames. Be aware that directory renamings may "
1430 "affect multiple cached pathnames."
1431 msgstr ""
1432 "Программный интерфейс inotify различает события по их дескрипторам "
1433 "сторожков. Приложение само должно кэшировать сопоставление (если нужно) "
1434 "дескрипторов сторожков и имён. Имейте в виду, что переименование каталога "
1435 "может повлиять на несколько кэшированных путей."
1436
1437 #. type: Plain text
1438 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1439 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1440 msgid ""
1441 "Inotify monitoring of directories is not recursive: to monitor "
1442 "subdirectories under a directory, additional watches must be created. This "
1443 "can take a significant amount time for large directory trees."
1444 msgstr ""
1445 "Отслеживание каталогов через inotify ведётся не рекурсивно: чтобы "
1446 "отслеживать подкаталоги, нужно создать дополнительные сторожки. Это может "
1447 "занять много времени при большом дереве каталога."
1448
1449 #. type: Plain text
1450 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1451 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1452 msgid ""
1453 "If monitoring an entire directory subtree, and a new subdirectory is created "
1454 "in that tree or an existing directory is renamed into that tree, be aware "
1455 "that by the time you create a watch for the new subdirectory, new files (and "
1456 "subdirectories) may already exist inside the subdirectory. Therefore, you "
1457 "may want to scan the contents of the subdirectory immediately after adding "
1458 "the watch (and, if desired, recursively add watches for any subdirectories "
1459 "that it contains)."
1460 msgstr ""
1461 "Если отслеживается полное дерево каталога и создаётся новый каталог в этом "
1462 "дереве или существующий каталог переименовывается в этом дереве, учтите, что "
1463 "на момент создания сторожка за новым подкаталогом, в подкаталоге могут уже "
1464 "существовать новые файлы (и подкаталоги). Поэтому вам может потребоваться "
1465 "сканировать содержимое подкаталога сразу после добавления сторожка (и, если "
1466 "нужно, рекурсивно добавить сторожки для всех подкаталогов, которые в нём "
1467 "есть)."
1468
1469 #. type: Plain text
1470 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1471 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1472 msgid ""
1473 "Note that the event queue can overflow. In this case, events are lost. "
1474 "Robust applications should handle the possibility of lost events "
1475 "gracefully. For example, it may be necessary to rebuild part or all of the "
1476 "application cache. (One simple, but possibly expensive, approach is to "
1477 "close the inotify file descriptor, empty the cache, create a new inotify "
1478 "file descriptor, and then re-create watches and cache entries for the "
1479 "objects to be monitored.)"
1480 msgstr ""
1481 "Заметим, что очередь событий может переполниться. В этом случае события "
1482 "теряются. Корректные приложения должны учитывать возможность пропажи "
1483 "событий. Например, может потребоваться перестроить часть или весь кэш "
1484 "приложения (один простой, но, возможно, затратный способ, это закрыть "
1485 "файловый дескриптор inotify, опустошить кэш, создать новый файловый "
1486 "дескриптор inotify и затем пересоздать сторожки и записи в кэше для "
1487 "отслеживаемых объектов)."
1488
1489 #. type: Plain text
1490 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1491 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1492 msgid ""
1493 "If a filesystem is mounted on top of a monitored directory, no event is "
1494 "generated, and no events are generated for objects immediately under the new "
1495 "mount point. If the filesystem is subsequently unmounted, events will "
1496 "subsequently be generated for the directory and the objects it contains."
1497 msgstr ""
1498 "Если файловая система смонтирована поверх отслеживаемого каталога, то "
1499 "событие не генерируются, а также не генерируются события для объектов, "
1500 "находящихся в новой точке монтирования на первом уровне. Если в дальнейшем "
1501 "файловая система отмонтируется, то события начнут генерироваться для "
1502 "каталога и содержащихся в нём объектов."
1503
1504 #. type: SS
1505 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1506 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1507 #, no-wrap
1508 msgid "Dealing with rename() events"
1509 msgstr "Работа с событиями rename()"
1510
1511 #. type: Plain text
1512 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1513 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1514 msgid ""
1515 "As noted above, the B<IN_MOVED_FROM> and B<IN_MOVED_TO> event pair that is "
1516 "generated by B<rename>(2) can be matched up via their shared cookie value. "
1517 "However, the task of matching has some challenges."
1518 msgstr ""
1519 "Как указывалось выше, из событий B<IN_MOVED_FROM> и B<IN_MOVED_TO>, "
1520 "генерируемых B<rename>(2), можно определить пару по их одинаковому значению "
1521 "cookie. Однако, с этой задачей есть несколько проблем."
1522
1523 #. type: Plain text
1524 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1525 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1526 msgid ""
1527 "These two events are usually consecutive in the event stream available when "
1528 "reading from the inotify file descriptor. However, this is not guaranteed. "
1529 "If multiple processes are triggering events for monitored objects, then (on "
1530 "rare occasions) an arbitrary number of other events may appear between the "
1531 "B<IN_MOVED_FROM> and B<IN_MOVED_TO> events. Furthermore, it is not "
1532 "guaranteed that the event pair is atomically inserted into the queue: there "
1533 "may be a brief interval where the B<IN_MOVED_FROM> has appeared, but the "
1534 "B<IN_MOVED_TO> has not."
1535 msgstr ""
1536 "Эти два события, обычно, стоят друг за другом в потоке событий, если читать "
1537 "из файлового дескриптора inotify. Однако, это не гарантируется. Если "
1538 "несколько процессов создают события для отслеживаемых объектов, то (в редких "
1539 "случаях) произвольное количество других событий может появиться между "
1540 "событиями B<IN_MOVED_FROM> и B<IN_MOVED_TO>. Кроме того, не гарантируется, "
1541 "что пара событий вставляется в очередь атомарно: может существовать короткий "
1542 "интервал, в котором B<IN_MOVED_FROM> уже появилось, а B<IN_MOVED_TO> ещё нет."
1543
1544 #. type: Plain text
1545 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1546 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1547 msgid ""
1548 "Matching up the B<IN_MOVED_FROM> and B<IN_MOVED_TO> event pair generated by "
1549 "B<rename>(2) is thus inherently racy. (Don't forget that if an object is "
1550 "renamed outside of a monitored directory, there may not even be an "
1551 "B<IN_MOVED_TO> event.) Heuristic approaches (e.g., assume the events are "
1552 "always consecutive) can be used to ensure a match in most cases, but will "
1553 "inevitably miss some cases, causing the application to perceive the "
1554 "B<IN_MOVED_FROM> and B<IN_MOVED_TO> events as being unrelated. If watch "
1555 "descriptors are destroyed and re-created as a result, then those watch "
1556 "descriptors will be inconsistent with the watch descriptors in any pending "
1557 "events. (Re-creating the inotify file descriptor and rebuilding the cache "
1558 "may be useful to deal with this scenario.)"
1559 msgstr ""
1560 "Соответствие B<IN_MOVED_FROM> и B<IN_MOVED_TO> паре событий, сгенерированных "
1561 "B<rename>(2), по сути, просто (не забудьте, что если объект "
1562 "переименовывается вне отслеживаемого каталога, то может не быть даже события "
1563 "B<IN_MOVED_TO>). Можно использовать эвристические предположения (например, "
1564 "что события всегда следуют друг за другом), что работает в большинстве "
1565 "случаев, но неминуемо не сработает в некоторых случаях, в которых приложение "
1566 "посчитает события B<IN_MOVED_FROM> и B<IN_MOVED_TO> несвязными. Если в "
1567 "результате дескрипторы сторожков будут уничтожены и пересозданы, то такие "
1568 "дескрипторы будут несогласованны с дескрипторами сторожков для любых "
1569 "ожидающих событий (пересоздание файлового дескриптора inotify и пересборка "
1570 "кэша может быть полезна в этом случае)."
1571
1572 #. type: Plain text
1573 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1574 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1575 #, fuzzy
1576 #| msgid ""
1577 #| "Applications should also allow for the possibility that the "
1578 #| "B<IN_MOVED_FROM> event was the last event that could fit in the buffer "
1579 #| "returned by the current call to B<read>(2), and the accompanying "
1580 #| "B<IN_MOVED_TO> event might be fetched only on the next B<read>(2), which "
1581 #| "should be done with a (small) timeout to allow for the fact that "
1582 #| "insertion of the B<IN_MOVED_FROM>-B<IN_MOVED_TO> event pair is not "
1583 #| "atomic, and also the possibility that there may not be any B<IN_MOVED_TO> "
1584 #| "event."
1585 msgid ""
1586 "Applications should also allow for the possibility that the B<IN_MOVED_FROM> "
1587 "event was the last event that could fit in the buffer returned by the "
1588 "current call to B<read>(2), and the accompanying B<IN_MOVED_TO> event might "
1589 "be fetched only on the next B<read>(2), which should be done with a (small) "
1590 "timeout to allow for the fact that insertion of the "
1591 "B<IN_MOVED_FROM>+B<IN_MOVED_TO> event pair is not atomic, and also the "
1592 "possibility that there may not be any B<IN_MOVED_TO> event."
1593 msgstr ""
1594 "Также приложения должны учитывать возможность того, что событие "
1595 "B<IN_MOVED_FROM> — последнее событие, которое попало в буфер, возвращаемый "
1596 "текущим вызовом B<read>(2), и сопутствующее событие B<IN_MOVED_TO> может "
1597 "быть получено только при следующем чтении B<read>(2), которое должно быть "
1598 "выполнено с (коротким) промежутком, позволяющим фактическую не атомарную "
1599 "вставку пары событий B<IN_MOVED_FROM>-B<IN_MOVED_TO>, и также возможность "
1600 "того, что может отсутствовать событие B<IN_MOVED_TO>."
1601
1602 #. type: SH
1603 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1604 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1605 #, no-wrap
1606 msgid "BUGS"
1607 msgstr "ПРОГРАММНЫЕ ОШИБКИ"
1608
1609 #. commit 820c12d5d6c0890bc93dd63893924a13041fdc35
1610 #. type: Plain text
1611 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1612 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1613 msgid ""
1614 "Before Linux 3.19, B<fallocate>(2) did not create any inotify events. "
1615 "Since Linux 3.19, calls to B<fallocate>(2) generate B<IN_MODIFY> events."
1616 msgstr ""
1617 "До Linux 3.19, B<fallocate>(2) не создавал события inotify. Начиная с Linux "
1618 "3.19, вызов B<fallocate>(2) генерирует событие B<IN_MODIFY>."
1619
1620 #. FIXME . kernel commit 611da04f7a31b2208e838be55a42c7a1310ae321
1621 #. implies that unmount events were buggy since Linux 2.6.11 to Linux 2.6.36
1622 #. type: Plain text
1623 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1624 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1625 #, fuzzy
1626 #| msgid ""
1627 #| "In kernels before 2.6.16, the B<IN_ONESHOT> I<mask> flag does not work."
1628 msgid "Before Linux 2.6.16, the B<IN_ONESHOT> I<mask> flag does not work."
1629 msgstr "В ядрах до 2.6.16 флаг B<IN_ONESHOT> в I<mask> не работает."
1630
1631 #. type: Plain text
1632 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1633 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1634 msgid ""
1635 "As originally designed and implemented, the B<IN_ONESHOT> flag did not cause "
1636 "an B<IN_IGNORED> event to be generated when the watch was dropped after one "
1637 "event. However, as an unintended effect of other changes, since Linux "
1638 "2.6.36, an B<IN_IGNORED> event is generated in this case."
1639 msgstr ""
1640 "В первоначальной задумке и реализации флаг B<IN_ONESHOT> не приводил к "
1641 "генерации события B<IN_IGNORED>, если наблюдение отменялось после одного "
1642 "события. Однако, как непреднамеренный эффект других изменений, начиная с "
1643 "Linux 2.6.36, событие B<IN_IGNORED> в этом случае генерируется."
1644
1645 #. commit 1c17d18e3775485bf1e0ce79575eb637a94494a2
1646 #. type: Plain text
1647 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1648 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1649 #, fuzzy
1650 #| msgid ""
1651 #| "Before kernel 2.6.25, the kernel code that was intended to coalesce "
1652 #| "successive identical events (i.e., the two most recent events could "
1653 #| "potentially be coalesced if the older had not yet been read) instead "
1654 #| "checked if the most recent event could be coalesced with the I<oldest> "
1655 #| "unread event."
1656 msgid ""
1657 "Before Linux 2.6.25, the kernel code that was intended to coalesce "
1658 "successive identical events (i.e., the two most recent events could "
1659 "potentially be coalesced if the older had not yet been read) instead "
1660 "checked if the most recent event could be coalesced with the I<oldest> "
1661 "unread event."
1662 msgstr ""
1663 "До ядра версии 2.6.25, код ядра, который отвечал за объединение последующих "
1664 "одинаковых событий (т. е., два самых новых события могли быть объединены, "
1665 "если старое событие ещё не было прочитано), вместо этого проверял, можно ли "
1666 "объединить самое новое событие с I<самым старым> непрочитанным событием."
1667
1668 #. FIXME . https://bugzilla.kernel.org/show_bug.cgi?id=77111
1669 #. type: Plain text
1670 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1671 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1672 #, fuzzy
1673 #| msgid ""
1674 #| "When a watch descriptor is removed by calling B<inotify_rm_watch>(2) (or "
1675 #| "because a watch file is deleted or the filesystem that contains it is "
1676 #| "unmounted), any pending unread events for that watch descriptor remain "
1677 #| "available to read. As watch descriptors are subsequently allocated with "
1678 #| "B<inotify_add_watch>(2), the kernel cycles through the range of possible "
1679 #| "watch descriptors (0 to B<INT_MAX>) incrementally. When allocating a "
1680 #| "free watch descriptor, no check is made to see whether that watch "
1681 #| "descriptor number has any pending unread events in the inotify queue. "
1682 #| "Thus, it can happen that a watch descriptor is reallocated even when "
1683 #| "pending unread events exist for a previous incarnation of that watch "
1684 #| "descriptor number, with the result that the application might then read "
1685 #| "those events and interpret them as belonging to the file associated with "
1686 #| "the newly recycled watch descriptor. In practice, the likelihood of "
1687 #| "hitting this bug may be extremely low, since it requires that an "
1688 #| "application cycle through B<INT_MAX> watch descriptors, release a watch "
1689 #| "descriptor while leaving unread events for that watch descriptor in the "
1690 #| "queue, and then recycle that watch descriptor. For this reason, and "
1691 #| "because there have been no reports of the bug occurring in real-world "
1692 #| "applications, as of Linux 3.15, no kernel changes have yet been made to "
1693 #| "eliminate this possible bug."
1694 msgid ""
1695 "When a watch descriptor is removed by calling B<inotify_rm_watch>(2) (or "
1696 "because a watch file is deleted or the filesystem that contains it is "
1697 "unmounted), any pending unread events for that watch descriptor remain "
1698 "available to read. As watch descriptors are subsequently allocated with "
1699 "B<inotify_add_watch>(2), the kernel cycles through the range of possible "
1700 "watch descriptors (1 to B<INT_MAX>) incrementally. When allocating a free "
1701 "watch descriptor, no check is made to see whether that watch descriptor "
1702 "number has any pending unread events in the inotify queue. Thus, it can "
1703 "happen that a watch descriptor is reallocated even when pending unread "
1704 "events exist for a previous incarnation of that watch descriptor number, "
1705 "with the result that the application might then read those events and "
1706 "interpret them as belonging to the file associated with the newly recycled "
1707 "watch descriptor. In practice, the likelihood of hitting this bug may be "
1708 "extremely low, since it requires that an application cycle through "
1709 "B<INT_MAX> watch descriptors, release a watch descriptor while leaving "
1710 "unread events for that watch descriptor in the queue, and then recycle that "
1711 "watch descriptor. For this reason, and because there have been no reports "
1712 "of the bug occurring in real-world applications, as of Linux 3.15, no kernel "
1713 "changes have yet been made to eliminate this possible bug."
1714 msgstr ""
1715 "Когда дескриптор сторожка удаляется вызовом B<inotify_rm_watch>(2) (или из-"
1716 "за удаления отслеживаемого файла, или размонтирования содержащей его "
1717 "файловой системы), все ожидающие непрочитанные события для этого дескриптора "
1718 "сторожка остаются доступными для чтения. Так как дескрипторы сторожков в "
1719 "дальнейшем циклически выделяются B<inotify_add_watch>(2), ядро поступательно "
1720 "проходит через диапазон возможных дескрипторов сторожков (от 0 до "
1721 "B<INT_MAX>). При выделении свободного дескриптора сторожка для выбранного "
1722 "номера не производится проверка того, есть ли какие-то ожидающие "
1723 "непрочитанные события в очереди inotify с таким номером или нет. То есть "
1724 "может случиться так, что дескриптор сторожка выделяется повторно даже когда "
1725 "существуют ожидающие непрочитанные события, оставшиеся от предыдущего "
1726 "выделения дескриптора сторожка с тем же номером; в результате приложение "
1727 "может прочесть эти события и посчитать их как принадлежащие файлу, "
1728 "связанному с новым повторно задействованным дескриптором сторожка. На "
1729 "практике, вероятность столкновения с этой ошибкой может быть чрезвычайно "
1730 "низка, так как для этого требуется, чтобы приложения циклически перебрало "
1731 "все B<INT_MAX> дескрипторов сторожков, освободило дескриптор сторожка и "
1732 "оставило непрочитанные события этого дескриптора сторожка в очереди, а затем "
1733 "повторно задействовало этот дескриптор сторожка. По этой причине и из-за "
1734 "того, что ещё никто не сообщал об этой ошибке в реальности, на момент "
1735 "актуальности Linux 3.15, в ядре ничего не было сделано для того, чтобы "
1736 "устранить этот дефект."
1737
1738 #. type: SH
1739 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1740 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1741 #, no-wrap
1742 msgid "EXAMPLES"
1743 msgstr "ПРИМЕРЫ"
1744
1745 #. type: Plain text
1746 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1747 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1748 #, fuzzy
1749 #| msgid ""
1750 #| "The following program demonstrates the usage of the inotify API. It "
1751 #| "marks the directories passed as a command-line arguments and waits for "
1752 #| "events of type B<IN_OPEN>, B<IN_CLOSE_NOWRITE> and B<IN_CLOSE_WRITE>."
1753 msgid ""
1754 "The following program demonstrates the usage of the inotify API. It marks "
1755 "the directories passed as a command-line arguments and waits for events of "
1756 "type B<IN_OPEN>, B<IN_CLOSE_NOWRITE>, and B<IN_CLOSE_WRITE>."
1757 msgstr ""
1758 "Следующая программа демонстрирует использование программного интерфейса "
1759 "inotify. Она помечает каталоги, переданной в аргументах командной строки, и "
1760 "ждёт событий с типом B<IN_OPEN>, B<IN_CLOSE_NOWRITE> и B<IN_CLOSE_WRITE>."
1761
1762 #. type: Plain text
1763 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1764 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1765 msgid ""
1766 "The following output was recorded while editing the file I</home/user/temp/"
1767 "foo> and listing directory I</tmp>. Before the file and the directory were "
1768 "opened, B<IN_OPEN> events occurred. After the file was closed, an "
1769 "B<IN_CLOSE_WRITE> event occurred. After the directory was closed, an "
1770 "B<IN_CLOSE_NOWRITE> event occurred. Execution of the program ended when the "
1771 "user pressed the ENTER key."
1772 msgstr ""
1773 "Следующий вывод был записан при редактировании файла I</home/user/temp/foo> "
1774 "и просмотра каталога I</tmp>. Перед открытием файла и каталога произошли "
1775 "события B<IN_OPEN>. После закрытия файла произошло событие "
1776 "B<IN_CLOSE_WRITE>. После закрытия каталога произошло событие "
1777 "B<IN_CLOSE_NOWRITE>. Выполнение программы закончилось после нажатия "
1778 "пользователем клавиши ENTER."
1779
1780 #. type: SS
1781 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1782 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1783 #, no-wrap
1784 msgid "Example output"
1785 msgstr "Пример вывода"
1786
1787 #. type: Plain text
1788 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
1789 #: opensuse-tumbleweed
1790 #, fuzzy, no-wrap
1791 #| msgid ""
1792 #| "$ B<./a.out /tmp /home/user/temp>\n"
1793 #| "Press enter key to terminate.\n"
1794 #| "Listening for events.\n"
1795 #| "IN_OPEN: /home/user/temp/foo [file]\n"
1796 #| "IN_CLOSE_WRITE: /home/user/temp/foo [file]\n"
1797 #| "IN_OPEN: /tmp/ [directory]\n"
1798 #| "IN_CLOSE_NOWRITE: /tmp/ [directory]\n"
1799 msgid ""
1800 "$B< ./a.out /tmp /home/user/temp>;\n"
1801 "Press enter key to terminate.\n"
1802 "Listening for events.\n"
1803 "IN_OPEN: /home/user/temp/foo [file]\n"
1804 "IN_CLOSE_WRITE: /home/user/temp/foo [file]\n"
1805 "IN_OPEN: /tmp/ [directory]\n"
1806 "IN_CLOSE_NOWRITE: /tmp/ [directory]\n"
1807 "\\&\n"
1808 "Listening for events stopped.\n"
1809 msgstr ""
1810 "$ B<./a.out /tmp /home/user/temp>\n"
1811 "Нажмите ENTER для завершения работы.\n"
1812 "Ожидание событий.\n"
1813 "IN_OPEN: /home/user/temp/foo [файл]\n"
1814 "IN_CLOSE_WRITE: /home/user/temp/foo [файл]\n"
1815 "IN_OPEN: /tmp/ [каталог]\n"
1816 "IN_CLOSE_NOWRITE: /tmp/ [каталог]\n"
1817
1818 #. type: SS
1819 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1820 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1821 #, no-wrap
1822 msgid "Program source"
1823 msgstr "Исходный код программы"
1824
1825 #. type: Plain text
1826 #: archlinux debian-unstable opensuse-leap-16-1 opensuse-tumbleweed
1827 #, no-wrap
1828 msgid ""
1829 "#include E<lt>errno.hE<gt>\n"
1830 "#include E<lt>poll.hE<gt>\n"
1831 "#include E<lt>stdio.hE<gt>\n"
1832 "#include E<lt>stdlib.hE<gt>\n"
1833 "#include E<lt>sys/inotify.hE<gt>\n"
1834 "#include E<lt>unistd.hE<gt>\n"
1835 "#include E<lt>string.hE<gt>\n"
1836 "\\&\n"
1837 "/* Read all available inotify events from the file descriptor \\[aq]fd\\[aq].\n"
1838 " wd is the table of watch descriptors for the directories in argv.\n"
1839 " argc is the size of wd and argv.\n"
1840 " argv is the list of watched directories.\n"
1841 " Entry 0 of wd and argv is unused. */\n"
1842 "\\&\n"
1843 "static void\n"
1844 "handle_events(int fd, int *wd, int argc, char* argv[])\n"
1845 "{\n"
1846 " /* Some systems cannot read integer variables if they are not\n"
1847 " properly aligned. On other systems, incorrect alignment may\n"
1848 " decrease performance. Hence, the buffer used for reading from\n"
1849 " the inotify file descriptor should have the same alignment as\n"
1850 " struct inotify_event. */\n"
1851 "\\&\n"
1852 " char buf[4096]\n"
1853 " __attribute__ ((aligned(__alignof__(struct inotify_event))));\n"
1854 " const struct inotify_event *event;\n"
1855 " ssize_t size;\n"
1856 "\\&\n"
1857 " /* Loop while events can be read from inotify file descriptor. */\n"
1858 "\\&\n"
1859 " for (;;) {\n"
1860 "\\&\n"
1861 " /* Read some events. */\n"
1862 "\\&\n"
1863 " size = read(fd, buf, sizeof(buf));\n"
1864 " if (size == -1 && errno != EAGAIN) {\n"
1865 " perror(\"read\");\n"
1866 " exit(EXIT_FAILURE);\n"
1867 " }\n"
1868 "\\&\n"
1869 " /* If the nonblocking read() found no events to read, then\n"
1870 " it returns -1 with errno set to EAGAIN. In that case,\n"
1871 " we exit the loop. */\n"
1872 "\\&\n"
1873 " if (size E<lt>= 0)\n"
1874 " break;\n"
1875 "\\&\n"
1876 " /* Loop over all events in the buffer. */\n"
1877 "\\&\n"
1878 " for (char *ptr = buf; ptr E<lt> buf + size;\n"
1879 " ptr += sizeof(struct inotify_event) + event-E<gt>len) {\n"
1880 "\\&\n"
1881 " event = (const struct inotify_event *) ptr;\n"
1882 "\\&\n"
1883 " /* Print event type. */\n"
1884 "\\&\n"
1885 " if (event-E<gt>mask & IN_OPEN)\n"
1886 " printf(\"IN_OPEN: \");\n"
1887 " if (event-E<gt>mask & IN_CLOSE_NOWRITE)\n"
1888 " printf(\"IN_CLOSE_NOWRITE: \");\n"
1889 " if (event-E<gt>mask & IN_CLOSE_WRITE)\n"
1890 " printf(\"IN_CLOSE_WRITE: \");\n"
1891 "\\&\n"
1892 " /* Print the name of the watched directory. */\n"
1893 "\\&\n"
1894 " for (size_t i = 1; i E<lt> argc; ++i) {\n"
1895 " if (wd[i] == event-E<gt>wd) {\n"
1896 " printf(\"%s/\", argv[i]);\n"
1897 " break;\n"
1898 " }\n"
1899 " }\n"
1900 "\\&\n"
1901 " /* Print the name of the file. */\n"
1902 "\\&\n"
1903 " if (event-E<gt>len)\n"
1904 " printf(\"%s\", event-E<gt>name);\n"
1905 "\\&\n"
1906 " /* Print type of filesystem object. */\n"
1907 "\\&\n"
1908 " if (event-E<gt>mask & IN_ISDIR)\n"
1909 " printf(\" [directory]\\[rs]n\");\n"
1910 " else\n"
1911 " printf(\" [file]\\[rs]n\");\n"
1912 " }\n"
1913 " }\n"
1914 "}\n"
1915 "\\&\n"
1916 "int\n"
1917 "main(int argc, char* argv[])\n"
1918 "{\n"
1919 " char buf;\n"
1920 " int fd, i, poll_num;\n"
1921 " int *wd;\n"
1922 " nfds_t nfds;\n"
1923 " struct pollfd fds[2];\n"
1924 "\\&\n"
1925 " if (argc E<lt> 2) {\n"
1926 " printf(\"Usage: %s PATH [PATH ...]\\[rs]n\", argv[0]);\n"
1927 " exit(EXIT_FAILURE);\n"
1928 " }\n"
1929 "\\&\n"
1930 " printf(\"Press ENTER key to terminate.\\[rs]n\");\n"
1931 "\\&\n"
1932 " /* Create the file descriptor for accessing the inotify API. */\n"
1933 "\\&\n"
1934 " fd = inotify_init1(IN_NONBLOCK);\n"
1935 " if (fd == -1) {\n"
1936 " perror(\"inotify_init1\");\n"
1937 " exit(EXIT_FAILURE);\n"
1938 " }\n"
1939 "\\&\n"
1940 " /* Allocate memory for watch descriptors. */\n"
1941 "\\&\n"
1942 " wd = calloc(argc, sizeof(int));\n"
1943 " if (wd == NULL) {\n"
1944 " perror(\"calloc\");\n"
1945 " exit(EXIT_FAILURE);\n"
1946 " }\n"
1947 "\\&\n"
1948 " /* Mark directories for events\n"
1949 " - file was opened\n"
1950 " - file was closed */\n"
1951 "\\&\n"
1952 " for (i = 1; i E<lt> argc; i++) {\n"
1953 " wd[i] = inotify_add_watch(fd, argv[i],\n"
1954 " IN_OPEN | IN_CLOSE);\n"
1955 " if (wd[i] == -1) {\n"
1956 " fprintf(stderr, \"Cannot watch \\[aq]%s\\[aq]: %s\\[rs]n\",\n"
1957 " argv[i], strerror(errno));\n"
1958 " exit(EXIT_FAILURE);\n"
1959 " }\n"
1960 " }\n"
1961 "\\&\n"
1962 " /* Prepare for polling. */\n"
1963 "\\&\n"
1964 " nfds = 2;\n"
1965 "\\&\n"
1966 " fds[0].fd = STDIN_FILENO; /* Console input */\n"
1967 " fds[0].events = POLLIN;\n"
1968 "\\&\n"
1969 " fds[1].fd = fd; /* Inotify input */\n"
1970 " fds[1].events = POLLIN;\n"
1971 "\\&\n"
1972 " /* Wait for events and/or terminal input. */\n"
1973 "\\&\n"
1974 " printf(\"Listening for events.\\[rs]n\");\n"
1975 " for (;;) {\n"
1976 " poll_num = poll(fds, nfds, -1);\n"
1977 " if (poll_num == -1) {\n"
1978 " if (errno == EINTR)\n"
1979 " continue;\n"
1980 " perror(\"poll\");\n"
1981 " exit(EXIT_FAILURE);\n"
1982 " }\n"
1983 "\\&\n"
1984 " if (poll_num E<gt> 0) {\n"
1985 "\\&\n"
1986 " if (fds[0].revents & POLLIN) {\n"
1987 "\\&\n"
1988 " /* Console input is available. Empty stdin and quit. */\n"
1989 "\\&\n"
1990 " while (read(STDIN_FILENO, &buf, 1) E<gt> 0 && buf != \\[aq]\\[rs]n\\[aq])\n"
1991 " continue;\n"
1992 " break;\n"
1993 " }\n"
1994 "\\&\n"
1995 " if (fds[1].revents & POLLIN) {\n"
1996 "\\&\n"
1997 " /* Inotify events are available. */\n"
1998 "\\&\n"
1999 " handle_events(fd, wd, argc, argv);\n"
2000 " }\n"
2001 " }\n"
2002 " }\n"
2003 "\\&\n"
2004 " printf(\"Listening for events stopped.\\[rs]n\");\n"
2005 "\\&\n"
2006 " /* Close inotify file descriptor. */\n"
2007 "\\&\n"
2008 " close(fd);\n"
2009 "\\&\n"
2010 " free(wd);\n"
2011 " exit(EXIT_SUCCESS);\n"
2012 "}\n"
2013 msgstr ""
2014
2015 #. type: SH
2016 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2017 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2018 #, no-wrap
2019 msgid "SEE ALSO"
2020 msgstr "СМОТРИТЕ ТАКЖЕ"
2021
2022 #. type: Plain text
2023 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2024 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2025 msgid ""
2026 "B<inotifywait>(1), B<inotifywatch>(1), B<inotify_add_watch>(2), "
2027 "B<inotify_init>(2), B<inotify_init1>(2), B<inotify_rm_watch>(2), B<read>(2), "
2028 "B<stat>(2), B<fanotify>(7)"
2029 msgstr ""
2030 "B<inotifywait>(1), B<inotifywatch>(1), B<inotify_add_watch>(2), "
2031 "B<inotify_init>(2), B<inotify_init1>(2), B<inotify_rm_watch>(2), B<read>(2), "
2032 "B<stat>(2), B<fanotify>(7)"
2033
2034 #. type: Plain text
2035 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
2036 #: opensuse-tumbleweed
2037 #, fuzzy
2038 #| msgid ""
2039 #| "I<Documentation/filesystems/inotify.txt> in the Linux kernel source tree"
2040 msgid ""
2041 "I<Documentation/filesystems/inotify.rst> in the Linux kernel source tree"
2042 msgstr ""
2043 "Файл I<Documentation/filesystems/inotify.txt> в дереве исходного кода ядра "
2044 "Linux"
2045
2046 #. type: TH
2047 #: debian-trixie
2048 #, no-wrap
2049 msgid "2024-06-15"
2050 msgstr "15 июня 2024 г."
2051
2052 #. type: TH
2053 #: debian-trixie
2054 #, no-wrap
2055 msgid "Linux man-pages 6.9.1"
2056 msgstr "Страницы руководства Linux 6.9.1"
2057
2058 #. FIXME . The type of the 'wd' field should probably be "int32_t".
2059 #. I submitted a patch to fix this. See the LKML thread
2060 #. "[patch] Fix type errors in inotify interfaces", 18 Nov 2008
2061 #. glibc bug filed: https://www.sourceware.org/bugzilla/show_bug.cgi?id=7040
2062 #. type: Plain text
2063 #: debian-trixie fedora-44 fedora-rawhide
2064 #, no-wrap
2065 msgid ""
2066 "struct inotify_event {\n"
2067 " int wd; /* Watch descriptor */\n"
2068 " uint32_t mask; /* Mask describing event */\n"
2069 " uint32_t cookie; /* Unique cookie associating related\n"
2070 " events (for rename(2)) */\n"
2071 " uint32_t len; /* Size of I<name> field */\n"
2072 " char name[]; /* Optional null-terminated name */\n"
2073 "};\n"
2074 msgstr ""
2075 "struct inotify_event {\n"
2076 " int wd; /* дескриптор наблюдаемого */\n"
2077 " uint32_t mask; /* маска, описывающая событие */\n"
2078 " uint32_t cookie; /* уникальный cookie, связывающий относящиеся\n"
2079 " друг к другу события (для rename(2)) */\n"
2080 " uint32_t len; /* размер поля I<name> */\n"
2081 " char name[]; /* необязательное имя, завершающееся null */\n"
2082 "};\n"
2083
2084 #. type: Plain text
2085 #: debian-trixie
2086 msgid ""
2087 "The I<len> field counts all of the bytes in I<name>, including the null "
2088 "bytes; the length of each I<inotify_event> structure is thus I<sizeof(struct "
2089 "inotify_event)+len>."
2090 msgstr ""
2091 "Поле I<len> содержит количество всех байт в I<name>, включая байты null; "
2092 "длина каждой структуры I<inotify_event> равна I<sizeof(struct inotify_event)"
2093 "+len>."
2094
2095 #. type: Plain text
2096 #: debian-trixie fedora-44 fedora-rawhide
2097 #, fuzzy, no-wrap
2098 #| msgid ""
2099 #| "$ B<./a.out /tmp /home/user/temp>\n"
2100 #| "Press enter key to terminate.\n"
2101 #| "Listening for events.\n"
2102 #| "IN_OPEN: /home/user/temp/foo [file]\n"
2103 #| "IN_CLOSE_WRITE: /home/user/temp/foo [file]\n"
2104 #| "IN_OPEN: /tmp/ [directory]\n"
2105 #| "IN_CLOSE_NOWRITE: /tmp/ [directory]\n"
2106 msgid ""
2107 "$ B<./a.out /tmp /home/user/temp>\n"
2108 "Press enter key to terminate.\n"
2109 "Listening for events.\n"
2110 "IN_OPEN: /home/user/temp/foo [file]\n"
2111 "IN_CLOSE_WRITE: /home/user/temp/foo [file]\n"
2112 "IN_OPEN: /tmp/ [directory]\n"
2113 "IN_CLOSE_NOWRITE: /tmp/ [directory]\n"
2114 "\\&\n"
2115 "Listening for events stopped.\n"
2116 msgstr ""
2117 "$ B<./a.out /tmp /home/user/temp>\n"
2118 "Нажмите ENTER для завершения работы.\n"
2119 "Ожидание событий.\n"
2120 "IN_OPEN: /home/user/temp/foo [файл]\n"
2121 "IN_CLOSE_WRITE: /home/user/temp/foo [файл]\n"
2122 "IN_OPEN: /tmp/ [каталог]\n"
2123 "IN_CLOSE_NOWRITE: /tmp/ [каталог]\n"
2124
2125 #. type: Plain text
2126 #: debian-trixie
2127 #, no-wrap
2128 msgid ""
2129 "#include E<lt>errno.hE<gt>\n"
2130 "#include E<lt>poll.hE<gt>\n"
2131 "#include E<lt>stdio.hE<gt>\n"
2132 "#include E<lt>stdlib.hE<gt>\n"
2133 "#include E<lt>sys/inotify.hE<gt>\n"
2134 "#include E<lt>unistd.hE<gt>\n"
2135 "#include E<lt>string.hE<gt>\n"
2136 "\\&\n"
2137 "/* Read all available inotify events from the file descriptor \\[aq]fd\\[aq].\n"
2138 " wd is the table of watch descriptors for the directories in argv.\n"
2139 " argc is the length of wd and argv.\n"
2140 " argv is the list of watched directories.\n"
2141 " Entry 0 of wd and argv is unused. */\n"
2142 "\\&\n"
2143 "static void\n"
2144 "handle_events(int fd, int *wd, int argc, char* argv[])\n"
2145 "{\n"
2146 " /* Some systems cannot read integer variables if they are not\n"
2147 " properly aligned. On other systems, incorrect alignment may\n"
2148 " decrease performance. Hence, the buffer used for reading from\n"
2149 " the inotify file descriptor should have the same alignment as\n"
2150 " struct inotify_event. */\n"
2151 "\\&\n"
2152 " char buf[4096]\n"
2153 " __attribute__ ((aligned(__alignof__(struct inotify_event))));\n"
2154 " const struct inotify_event *event;\n"
2155 " ssize_t len;\n"
2156 "\\&\n"
2157 " /* Loop while events can be read from inotify file descriptor. */\n"
2158 "\\&\n"
2159 " for (;;) {\n"
2160 "\\&\n"
2161 " /* Read some events. */\n"
2162 "\\&\n"
2163 " len = read(fd, buf, sizeof(buf));\n"
2164 " if (len == -1 && errno != EAGAIN) {\n"
2165 " perror(\"read\");\n"
2166 " exit(EXIT_FAILURE);\n"
2167 " }\n"
2168 "\\&\n"
2169 " /* If the nonblocking read() found no events to read, then\n"
2170 " it returns -1 with errno set to EAGAIN. In that case,\n"
2171 " we exit the loop. */\n"
2172 "\\&\n"
2173 " if (len E<lt>= 0)\n"
2174 " break;\n"
2175 "\\&\n"
2176 " /* Loop over all events in the buffer. */\n"
2177 "\\&\n"
2178 " for (char *ptr = buf; ptr E<lt> buf + len;\n"
2179 " ptr += sizeof(struct inotify_event) + event-E<gt>len) {\n"
2180 "\\&\n"
2181 " event = (const struct inotify_event *) ptr;\n"
2182 "\\&\n"
2183 " /* Print event type. */\n"
2184 "\\&\n"
2185 " if (event-E<gt>mask & IN_OPEN)\n"
2186 " printf(\"IN_OPEN: \");\n"
2187 " if (event-E<gt>mask & IN_CLOSE_NOWRITE)\n"
2188 " printf(\"IN_CLOSE_NOWRITE: \");\n"
2189 " if (event-E<gt>mask & IN_CLOSE_WRITE)\n"
2190 " printf(\"IN_CLOSE_WRITE: \");\n"
2191 "\\&\n"
2192 " /* Print the name of the watched directory. */\n"
2193 "\\&\n"
2194 " for (size_t i = 1; i E<lt> argc; ++i) {\n"
2195 " if (wd[i] == event-E<gt>wd) {\n"
2196 " printf(\"%s/\", argv[i]);\n"
2197 " break;\n"
2198 " }\n"
2199 " }\n"
2200 "\\&\n"
2201 " /* Print the name of the file. */\n"
2202 "\\&\n"
2203 " if (event-E<gt>len)\n"
2204 " printf(\"%s\", event-E<gt>name);\n"
2205 "\\&\n"
2206 " /* Print type of filesystem object. */\n"
2207 "\\&\n"
2208 " if (event-E<gt>mask & IN_ISDIR)\n"
2209 " printf(\" [directory]\\[rs]n\");\n"
2210 " else\n"
2211 " printf(\" [file]\\[rs]n\");\n"
2212 " }\n"
2213 " }\n"
2214 "}\n"
2215 "\\&\n"
2216 "int\n"
2217 "main(int argc, char* argv[])\n"
2218 "{\n"
2219 " char buf;\n"
2220 " int fd, i, poll_num;\n"
2221 " int *wd;\n"
2222 " nfds_t nfds;\n"
2223 " struct pollfd fds[2];\n"
2224 "\\&\n"
2225 " if (argc E<lt> 2) {\n"
2226 " printf(\"Usage: %s PATH [PATH ...]\\[rs]n\", argv[0]);\n"
2227 " exit(EXIT_FAILURE);\n"
2228 " }\n"
2229 "\\&\n"
2230 " printf(\"Press ENTER key to terminate.\\[rs]n\");\n"
2231 "\\&\n"
2232 " /* Create the file descriptor for accessing the inotify API. */\n"
2233 "\\&\n"
2234 " fd = inotify_init1(IN_NONBLOCK);\n"
2235 " if (fd == -1) {\n"
2236 " perror(\"inotify_init1\");\n"
2237 " exit(EXIT_FAILURE);\n"
2238 " }\n"
2239 "\\&\n"
2240 " /* Allocate memory for watch descriptors. */\n"
2241 "\\&\n"
2242 " wd = calloc(argc, sizeof(int));\n"
2243 " if (wd == NULL) {\n"
2244 " perror(\"calloc\");\n"
2245 " exit(EXIT_FAILURE);\n"
2246 " }\n"
2247 "\\&\n"
2248 " /* Mark directories for events\n"
2249 " - file was opened\n"
2250 " - file was closed */\n"
2251 "\\&\n"
2252 " for (i = 1; i E<lt> argc; i++) {\n"
2253 " wd[i] = inotify_add_watch(fd, argv[i],\n"
2254 " IN_OPEN | IN_CLOSE);\n"
2255 " if (wd[i] == -1) {\n"
2256 " fprintf(stderr, \"Cannot watch \\[aq]%s\\[aq]: %s\\[rs]n\",\n"
2257 " argv[i], strerror(errno));\n"
2258 " exit(EXIT_FAILURE);\n"
2259 " }\n"
2260 " }\n"
2261 "\\&\n"
2262 " /* Prepare for polling. */\n"
2263 "\\&\n"
2264 " nfds = 2;\n"
2265 "\\&\n"
2266 " fds[0].fd = STDIN_FILENO; /* Console input */\n"
2267 " fds[0].events = POLLIN;\n"
2268 "\\&\n"
2269 " fds[1].fd = fd; /* Inotify input */\n"
2270 " fds[1].events = POLLIN;\n"
2271 "\\&\n"
2272 " /* Wait for events and/or terminal input. */\n"
2273 "\\&\n"
2274 " printf(\"Listening for events.\\[rs]n\");\n"
2275 " while (1) {\n"
2276 " poll_num = poll(fds, nfds, -1);\n"
2277 " if (poll_num == -1) {\n"
2278 " if (errno == EINTR)\n"
2279 " continue;\n"
2280 " perror(\"poll\");\n"
2281 " exit(EXIT_FAILURE);\n"
2282 " }\n"
2283 "\\&\n"
2284 " if (poll_num E<gt> 0) {\n"
2285 "\\&\n"
2286 " if (fds[0].revents & POLLIN) {\n"
2287 "\\&\n"
2288 " /* Console input is available. Empty stdin and quit. */\n"
2289 "\\&\n"
2290 " while (read(STDIN_FILENO, &buf, 1) E<gt> 0 && buf != \\[aq]\\[rs]n\\[aq])\n"
2291 " continue;\n"
2292 " break;\n"
2293 " }\n"
2294 "\\&\n"
2295 " if (fds[1].revents & POLLIN) {\n"
2296 "\\&\n"
2297 " /* Inotify events are available. */\n"
2298 "\\&\n"
2299 " handle_events(fd, wd, argc, argv);\n"
2300 " }\n"
2301 " }\n"
2302 " }\n"
2303 "\\&\n"
2304 " printf(\"Listening for events stopped.\\[rs]n\");\n"
2305 "\\&\n"
2306 " /* Close inotify file descriptor. */\n"
2307 "\\&\n"
2308 " close(fd);\n"
2309 "\\&\n"
2310 " free(wd);\n"
2311 " exit(EXIT_SUCCESS);\n"
2312 "}\n"
2313 msgstr ""
2314
2315 #. type: Plain text
2316 #: debian-trixie fedora-44 fedora-rawhide
2317 msgid ""
2318 "I<Documentation/filesystems/inotify.txt> in the Linux kernel source tree"
2319 msgstr ""
2320 "Файл I<Documentation/filesystems/inotify.txt> в дереве исходного кода ядра "
2321 "Linux"
2322
2323 #. type: TH
2324 #: fedora-44 fedora-rawhide
2325 #, no-wrap
2326 msgid "2024-11-17"
2327 msgstr "17 ноября 2024 г."
2328
2329 #. type: TH
2330 #: fedora-44 fedora-rawhide
2331 #, no-wrap
2332 msgid "Linux man-pages 6.13"
2333 msgstr "Страницы руководства Linux 6.13"
2334
2335 #. type: Plain text
2336 #: fedora-44 fedora-rawhide
2337 #, no-wrap
2338 msgid ""
2339 "#include E<lt>errno.hE<gt>\n"
2340 "#include E<lt>poll.hE<gt>\n"
2341 "#include E<lt>stdio.hE<gt>\n"
2342 "#include E<lt>stdlib.hE<gt>\n"
2343 "#include E<lt>sys/inotify.hE<gt>\n"
2344 "#include E<lt>unistd.hE<gt>\n"
2345 "#include E<lt>string.hE<gt>\n"
2346 "\\&\n"
2347 "/* Read all available inotify events from the file descriptor \\[aq]fd\\[aq].\n"
2348 " wd is the table of watch descriptors for the directories in argv.\n"
2349 " argc is the size of wd and argv.\n"
2350 " argv is the list of watched directories.\n"
2351 " Entry 0 of wd and argv is unused. */\n"
2352 "\\&\n"
2353 "static void\n"
2354 "handle_events(int fd, int *wd, int argc, char* argv[])\n"
2355 "{\n"
2356 " /* Some systems cannot read integer variables if they are not\n"
2357 " properly aligned. On other systems, incorrect alignment may\n"
2358 " decrease performance. Hence, the buffer used for reading from\n"
2359 " the inotify file descriptor should have the same alignment as\n"
2360 " struct inotify_event. */\n"
2361 "\\&\n"
2362 " char buf[4096]\n"
2363 " __attribute__ ((aligned(__alignof__(struct inotify_event))));\n"
2364 " const struct inotify_event *event;\n"
2365 " ssize_t size;\n"
2366 "\\&\n"
2367 " /* Loop while events can be read from inotify file descriptor. */\n"
2368 "\\&\n"
2369 " for (;;) {\n"
2370 "\\&\n"
2371 " /* Read some events. */\n"
2372 "\\&\n"
2373 " size = read(fd, buf, sizeof(buf));\n"
2374 " if (size == -1 && errno != EAGAIN) {\n"
2375 " perror(\"read\");\n"
2376 " exit(EXIT_FAILURE);\n"
2377 " }\n"
2378 "\\&\n"
2379 " /* If the nonblocking read() found no events to read, then\n"
2380 " it returns -1 with errno set to EAGAIN. In that case,\n"
2381 " we exit the loop. */\n"
2382 "\\&\n"
2383 " if (size E<lt>= 0)\n"
2384 " break;\n"
2385 "\\&\n"
2386 " /* Loop over all events in the buffer. */\n"
2387 "\\&\n"
2388 " for (char *ptr = buf; ptr E<lt> buf + size;\n"
2389 " ptr += sizeof(struct inotify_event) + event-E<gt>len) {\n"
2390 "\\&\n"
2391 " event = (const struct inotify_event *) ptr;\n"
2392 "\\&\n"
2393 " /* Print event type. */\n"
2394 "\\&\n"
2395 " if (event-E<gt>mask & IN_OPEN)\n"
2396 " printf(\"IN_OPEN: \");\n"
2397 " if (event-E<gt>mask & IN_CLOSE_NOWRITE)\n"
2398 " printf(\"IN_CLOSE_NOWRITE: \");\n"
2399 " if (event-E<gt>mask & IN_CLOSE_WRITE)\n"
2400 " printf(\"IN_CLOSE_WRITE: \");\n"
2401 "\\&\n"
2402 " /* Print the name of the watched directory. */\n"
2403 "\\&\n"
2404 " for (size_t i = 1; i E<lt> argc; ++i) {\n"
2405 " if (wd[i] == event-E<gt>wd) {\n"
2406 " printf(\"%s/\", argv[i]);\n"
2407 " break;\n"
2408 " }\n"
2409 " }\n"
2410 "\\&\n"
2411 " /* Print the name of the file. */\n"
2412 "\\&\n"
2413 " if (event-E<gt>len)\n"
2414 " printf(\"%s\", event-E<gt>name);\n"
2415 "\\&\n"
2416 " /* Print type of filesystem object. */\n"
2417 "\\&\n"
2418 " if (event-E<gt>mask & IN_ISDIR)\n"
2419 " printf(\" [directory]\\[rs]n\");\n"
2420 " else\n"
2421 " printf(\" [file]\\[rs]n\");\n"
2422 " }\n"
2423 " }\n"
2424 "}\n"
2425 "\\&\n"
2426 "int\n"
2427 "main(int argc, char* argv[])\n"
2428 "{\n"
2429 " char buf;\n"
2430 " int fd, i, poll_num;\n"
2431 " int *wd;\n"
2432 " nfds_t nfds;\n"
2433 " struct pollfd fds[2];\n"
2434 "\\&\n"
2435 " if (argc E<lt> 2) {\n"
2436 " printf(\"Usage: %s PATH [PATH ...]\\[rs]n\", argv[0]);\n"
2437 " exit(EXIT_FAILURE);\n"
2438 " }\n"
2439 "\\&\n"
2440 " printf(\"Press ENTER key to terminate.\\[rs]n\");\n"
2441 "\\&\n"
2442 " /* Create the file descriptor for accessing the inotify API. */\n"
2443 "\\&\n"
2444 " fd = inotify_init1(IN_NONBLOCK);\n"
2445 " if (fd == -1) {\n"
2446 " perror(\"inotify_init1\");\n"
2447 " exit(EXIT_FAILURE);\n"
2448 " }\n"
2449 "\\&\n"
2450 " /* Allocate memory for watch descriptors. */\n"
2451 "\\&\n"
2452 " wd = calloc(argc, sizeof(int));\n"
2453 " if (wd == NULL) {\n"
2454 " perror(\"calloc\");\n"
2455 " exit(EXIT_FAILURE);\n"
2456 " }\n"
2457 "\\&\n"
2458 " /* Mark directories for events\n"
2459 " - file was opened\n"
2460 " - file was closed */\n"
2461 "\\&\n"
2462 " for (i = 1; i E<lt> argc; i++) {\n"
2463 " wd[i] = inotify_add_watch(fd, argv[i],\n"
2464 " IN_OPEN | IN_CLOSE);\n"
2465 " if (wd[i] == -1) {\n"
2466 " fprintf(stderr, \"Cannot watch \\[aq]%s\\[aq]: %s\\[rs]n\",\n"
2467 " argv[i], strerror(errno));\n"
2468 " exit(EXIT_FAILURE);\n"
2469 " }\n"
2470 " }\n"
2471 "\\&\n"
2472 " /* Prepare for polling. */\n"
2473 "\\&\n"
2474 " nfds = 2;\n"
2475 "\\&\n"
2476 " fds[0].fd = STDIN_FILENO; /* Console input */\n"
2477 " fds[0].events = POLLIN;\n"
2478 "\\&\n"
2479 " fds[1].fd = fd; /* Inotify input */\n"
2480 " fds[1].events = POLLIN;\n"
2481 "\\&\n"
2482 " /* Wait for events and/or terminal input. */\n"
2483 "\\&\n"
2484 " printf(\"Listening for events.\\[rs]n\");\n"
2485 " while (1) {\n"
2486 " poll_num = poll(fds, nfds, -1);\n"
2487 " if (poll_num == -1) {\n"
2488 " if (errno == EINTR)\n"
2489 " continue;\n"
2490 " perror(\"poll\");\n"
2491 " exit(EXIT_FAILURE);\n"
2492 " }\n"
2493 "\\&\n"
2494 " if (poll_num E<gt> 0) {\n"
2495 "\\&\n"
2496 " if (fds[0].revents & POLLIN) {\n"
2497 "\\&\n"
2498 " /* Console input is available. Empty stdin and quit. */\n"
2499 "\\&\n"
2500 " while (read(STDIN_FILENO, &buf, 1) E<gt> 0 && buf != \\[aq]\\[rs]n\\[aq])\n"
2501 " continue;\n"
2502 " break;\n"
2503 " }\n"
2504 "\\&\n"
2505 " if (fds[1].revents & POLLIN) {\n"
2506 "\\&\n"
2507 " /* Inotify events are available. */\n"
2508 "\\&\n"
2509 " handle_events(fd, wd, argc, argv);\n"
2510 " }\n"
2511 " }\n"
2512 " }\n"
2513 "\\&\n"
2514 " printf(\"Listening for events stopped.\\[rs]n\");\n"
2515 "\\&\n"
2516 " /* Close inotify file descriptor. */\n"
2517 "\\&\n"
2518 " close(fd);\n"
2519 "\\&\n"
2520 " free(wd);\n"
2521 " exit(EXIT_SUCCESS);\n"
2522 "}\n"
2523 msgstr ""
2524
2525 #. type: TH
2526 #: mageia-cauldron
2527 #, no-wrap
2528 msgid "2026-02-08"
2529 msgstr "8 февраля 2026 г."
2530
2531 #. type: TH
2532 #: mageia-cauldron
2533 #, no-wrap
2534 msgid "Linux man-pages 6.17"
2535 msgstr "Страницы руководства Linux 6.17"
2536
2537 #. type: Plain text
2538 #: mageia-cauldron
2539 #, no-wrap
2540 msgid ""
2541 "#include E<lt>errno.hE<gt>\n"
2542 "#include E<lt>poll.hE<gt>\n"
2543 "#include E<lt>stdio.hE<gt>\n"
2544 "#include E<lt>stdlib.hE<gt>\n"
2545 "#include E<lt>sys/inotify.hE<gt>\n"
2546 "#include E<lt>unistd.hE<gt>\n"
2547 "#include E<lt>string.hE<gt>\n"
2548 "\\&\n"
2549 "/* Read all available inotify events from the file descriptor \\[aq]fd\\[aq].\n"
2550 " wd is the table of watch descriptors for the directories in argv.\n"
2551 " argc is the size of wd and argv.\n"
2552 " argv is the list of watched directories.\n"
2553 " Entry 0 of wd and argv is unused. */\n"
2554 "\\&\n"
2555 "static void\n"
2556 "handle_events(int fd, int *wd, int argc, char* argv[])\n"
2557 "{\n"
2558 " /* Some systems cannot read integer variables if they are not\n"
2559 " properly aligned. On other systems, incorrect alignment may\n"
2560 " decrease performance. Hence, the buffer used for reading from\n"
2561 " the inotify file descriptor should have the same alignment as\n"
2562 " struct inotify_event. */\n"
2563 "\\&\n"
2564 " char buf[4096]\n"
2565 " __attribute__ ((aligned(__alignof__(struct inotify_event))));\n"
2566 " const struct inotify_event *event;\n"
2567 " ssize_t size;\n"
2568 "\\&\n"
2569 " /* Loop while events can be read from inotify file descriptor. */\n"
2570 "\\&\n"
2571 " for (;;) {\n"
2572 "\\&\n"
2573 " /* Read some events. */\n"
2574 "\\&\n"
2575 " size = read(fd, buf, sizeof(buf));\n"
2576 " if (size == -1 && errno != EAGAIN) {\n"
2577 " perror(\"read\");\n"
2578 " exit(EXIT_FAILURE);\n"
2579 " }\n"
2580 "\\&\n"
2581 " /* If the nonblocking read() found no events to read, then\n"
2582 " it returns -1 with errno set to EAGAIN. In that case,\n"
2583 " we exit the loop. */\n"
2584 "\\&\n"
2585 " if (size E<lt>= 0)\n"
2586 " break;\n"
2587 "\\&\n"
2588 " /* Loop over all events in the buffer. */\n"
2589 "\\&\n"
2590 " for (char *ptr = buf; ptr E<lt> buf + size;\n"
2591 " ptr += sizeof(struct inotify_event) + event-E<gt>len) {\n"
2592 "\\&\n"
2593 " event = (const struct inotify_event *) ptr;\n"
2594 "\\&\n"
2595 " /* Print event type. */\n"
2596 "\\&\n"
2597 " if (event-E<gt>mask & IN_OPEN)\n"
2598 " printf(\"IN_OPEN: \");\n"
2599 " if (event-E<gt>mask & IN_CLOSE_NOWRITE)\n"
2600 " printf(\"IN_CLOSE_NOWRITE: \");\n"
2601 " if (event-E<gt>mask & IN_CLOSE_WRITE)\n"
2602 " printf(\"IN_CLOSE_WRITE: \");\n"
2603 "\\&\n"
2604 " /* Print the name of the watched directory. */\n"
2605 "\\&\n"
2606 " for (size_t i = 1; i E<lt> argc; ++i) {\n"
2607 " if (wd[i] == event-E<gt>wd) {\n"
2608 " printf(\"%s/\", argv[i]);\n"
2609 " break;\n"
2610 " }\n"
2611 " }\n"
2612 "\\&\n"
2613 " /* Print the name of the file. */\n"
2614 "\\&\n"
2615 " if (event-E<gt>len)\n"
2616 " printf(\"%s\", event-E<gt>name);\n"
2617 "\\&\n"
2618 " /* Print type of filesystem object. */\n"
2619 "\\&\n"
2620 " if (event-E<gt>mask & IN_ISDIR)\n"
2621 " printf(\" [directory]\\[rs]n\");\n"
2622 " else\n"
2623 " printf(\" [file]\\[rs]n\");\n"
2624 " }\n"
2625 " }\n"
2626 "}\n"
2627 "\\&\n"
2628 "int\n"
2629 "main(int argc, char* argv[])\n"
2630 "{\n"
2631 " char buf;\n"
2632 " int fd, i, poll_num;\n"
2633 " int *wd;\n"
2634 " nfds_t nfds;\n"
2635 " struct pollfd fds[2];\n"
2636 "\\&\n"
2637 " if (argc E<lt> 2) {\n"
2638 " printf(\"Usage: %s PATH [PATH ...]\\[rs]n\", argv[0]);\n"
2639 " exit(EXIT_FAILURE);\n"
2640 " }\n"
2641 "\\&\n"
2642 " printf(\"Press ENTER key to terminate.\\[rs]n\");\n"
2643 "\\&\n"
2644 " /* Create the file descriptor for accessing the inotify API. */\n"
2645 "\\&\n"
2646 " fd = inotify_init1(IN_NONBLOCK);\n"
2647 " if (fd == -1) {\n"
2648 " perror(\"inotify_init1\");\n"
2649 " exit(EXIT_FAILURE);\n"
2650 " }\n"
2651 "\\&\n"
2652 " /* Allocate memory for watch descriptors. */\n"
2653 "\\&\n"
2654 " wd = calloc(argc, sizeof(int));\n"
2655 " if (wd == NULL) {\n"
2656 " perror(\"calloc\");\n"
2657 " exit(EXIT_FAILURE);\n"
2658 " }\n"
2659 "\\&\n"
2660 " /* Mark directories for events\n"
2661 " - file was opened\n"
2662 " - file was closed */\n"
2663 "\\&\n"
2664 " for (i = 1; i E<lt> argc; i++) {\n"
2665 " wd[i] = inotify_add_watch(fd, argv[i],\n"
2666 " IN_OPEN | IN_CLOSE);\n"
2667 " if (wd[i] == -1) {\n"
2668 " fprintf(stderr, \"Cannot watch \\[aq]%s\\[aq]: %s\\[rs]n\",\n"
2669 " argv[i], strerror(errno));\n"
2670 " exit(EXIT_FAILURE);\n"
2671 " }\n"
2672 " }\n"
2673 "\\&\n"
2674 " /* Prepare for polling. */\n"
2675 "\\&\n"
2676 " nfds = 2;\n"
2677 "\\&\n"
2678 " fds[0].fd = STDIN_FILENO; /* Console input */\n"
2679 " fds[0].events = POLLIN;\n"
2680 "\\&\n"
2681 " fds[1].fd = fd; /* Inotify input */\n"
2682 " fds[1].events = POLLIN;\n"
2683 "\\&\n"
2684 " /* Wait for events and/or terminal input. */\n"
2685 "\\&\n"
2686 " printf(\"Listening for events.\\[rs]n\");\n"
2687 " while (1) {\n"
2688 " poll_num = poll(fds, nfds, -1);\n"
2689 " if (poll_num == -1) {\n"
2690 " if (errno == EINTR)\n"
2691 " continue;\n"
2692 " perror(\"poll\");\n"
2693 " exit(EXIT_FAILURE);\n"
2694 " }\n"
2695 "\\&\n"
2696 " if (poll_num E<gt> 0) {\n"
2697 "\\&\n"
2698 " if (fds[0].revents & POLLIN) {\n"
2699 "\\&\n"
2700 " /* Console input is available. Empty stdin and quit. */\n"
2701 "\\&\n"
2702 " while (read(STDIN_FILENO, &buf, 1) E<gt> 0 && buf != \\[aq]\\[rs]n\\[aq])\n"
2703 " continue;\n"
2704 " break;\n"
2705 " }\n"
2706 "\\&\n"
2707 " if (fds[1].revents & POLLIN) {\n"
2708 "\\&\n"
2709 " /* Inotify events are available. */\n"
2710 "\\&\n"
2711 " handle_events(fd, wd, argc, argv);\n"
2712 " }\n"
2713 " }\n"
2714 " }\n"
2715 "\\&\n"
2716 " printf(\"Listening for events stopped.\\[rs]n\");\n"
2717 "\\&\n"
2718 " /* Close inotify file descriptor. */\n"
2719 "\\&\n"
2720 " close(fd);\n"
2721 "\\&\n"
2722 " free(wd);\n"
2723 " exit(EXIT_SUCCESS);\n"
2724 "}\n"
2725 msgstr ""
2726
2727 #. type: TH
2728 #: opensuse-leap-16-1 opensuse-tumbleweed
2729 #, no-wrap
2730 msgid "Linux man-pages (unreleased)"
2731 msgstr "Страницы руководства Linux (не выпущены)"