Debian Codegraph @

po/fr/man7/inotify.7.po

raw
1 # French translation of manpages
2 # This file is distributed under the same license as the manpages-l10n package.
3 # Copyright © of this file:
4 # Christophe Blaess <https://www.blaess.fr/christophe/>, 1996-2003.
5 # Stéphan Rafin <[email protected]>, 2002.
6 # Thierry Vignaud <[email protected]>, 1999, 2002.
7 # François Micaux, 2002.
8 # Alain Portal <[email protected]>, 2003-2008.
9 # Jean-Philippe Guérard <[email protected]>, 2005-2006.
10 # Jean-Luc Coulon (f5ibh) <[email protected]>, 2006-2007.
11 # Julien Cristau <[email protected]>, 2006-2007.
12 # Thomas Huriaux <[email protected]>, 2006-2008.
13 # Nicolas François <[email protected]>, 2006-2008.
14 # Florentin Duneau <[email protected]>, 2006-2010.
15 # Simon Paillard <[email protected]>, 2006.
16 # Denis Barbier <[email protected]>, 2006, 2010.
17 # David Prévot <[email protected]>, 2010, 2012-2014.
18 # Thomas Vincent <[email protected]>, 2018.
19 # Jean-Pierre Giraud <[email protected]>, 2024.
20 msgid ""
21 msgstr ""
22 "Project-Id-Version: manpages-l10n 4.21.0\n"
23 "POT-Creation-Date: 2026-06-05 06:27+0200\n"
24 "PO-Revision-Date: 2024-02-25 19:15+0100\n"
25 "Last-Translator: Jean-Pierre Giraud <[email protected]>\n"
26 "Language-Team: French <[email protected]>\n"
27 "Language: fr\n"
28 "MIME-Version: 1.0\n"
29 "Content-Type: text/plain; charset=UTF-8\n"
30 "Content-Transfer-Encoding: 8bit\n"
31 "Plural-Forms: nplurals=2; plural=n > 1;\n"
32 "X-Generator: Poedit 1.8.11\n"
33
34 #. type: TH
35 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
36 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
37 #, no-wrap
38 msgid "inotify"
39 msgstr "inotify"
40
41 #. type: TH
42 #: archlinux debian-unstable opensuse-leap-16-1 opensuse-tumbleweed
43 #, no-wrap
44 msgid "2026-02-14"
45 msgstr "14 février 2026"
46
47 #. type: TH
48 #: archlinux debian-unstable
49 #, no-wrap
50 msgid "Linux man-pages 6.18"
51 msgstr "Pages du manuel de Linux 6.18"
52
53 #. type: SH
54 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
55 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
56 #, no-wrap
57 msgid "NAME"
58 msgstr "NOM"
59
60 #. type: Plain text
61 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
62 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
63 msgid "inotify - monitoring filesystem events"
64 msgstr "inotify - Surveiller les événements des systèmes de fichiers"
65
66 #. type: SH
67 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
68 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
69 #, no-wrap
70 msgid "DESCRIPTION"
71 msgstr "DESCRIPTION"
72
73 #. type: Plain text
74 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
75 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
76 msgid ""
77 "The I<inotify> API provides a mechanism for monitoring filesystem events. "
78 "Inotify can be used to monitor individual files, or to monitor directories. "
79 "When a directory is monitored, inotify will return events for the directory "
80 "itself, and for files inside the directory."
81 msgstr ""
82 "L'API I<inotify> fournit un mécanisme pour surveiller les événements au "
83 "niveau des systèmes de fichiers. Inotify peut être utilisé pour surveiller "
84 "des fichiers individuels ou des répertoires. Quand un répertoire est "
85 "surveillé, inotify va signaler des événements pour le répertoire lui-même et "
86 "pour les fichiers de ce répertoire."
87
88 #. type: Plain text
89 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
90 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
91 msgid "The following system calls are used with this API:"
92 msgstr ""
93 "Les appels système suivants sont utilisés avec cette interface de "
94 "programmation :"
95
96 #. type: IP
97 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
98 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
99 #, no-wrap
100 msgid "\\[bu]"
101 msgstr "-"
102
103 #. type: Plain text
104 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
105 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
106 msgid ""
107 "B<inotify_init>(2) creates an inotify instance and returns a file "
108 "descriptor referring to the inotify instance. The more recent "
109 "B<inotify_init1>(2) is like B<inotify_init>(2), but has a I<flags> argument "
110 "that provides access to some extra functionality."
111 msgstr ""
112 "B<inotify_init>(2) crée une instance inotify et renvoie un descripteur de "
113 "fichier se référant à cette instance inotify. L'appel système plus récent "
114 "B<inotify_init1>(2) est comme B<inotify_init>(2), mais a un argument "
115 "I<flags> qui fournit un accès à des fonctionnalités supplémentaires."
116
117 #. type: Plain text
118 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
119 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
120 msgid ""
121 "B<inotify_add_watch>(2) manipulates the \"watch list\" associated with an "
122 "inotify instance. Each item (\"watch\") in the watch list specifies the "
123 "pathname of a file or directory, along with some set of events that the "
124 "kernel should monitor for the file referred to by that pathname. "
125 "B<inotify_add_watch>(2) either creates a new watch item, or modifies an "
126 "existing watch. Each watch has a unique \"watch descriptor\", an integer "
127 "returned by B<inotify_add_watch>(2) when the watch is created."
128 msgstr ""
129 "B<inotify_add_watch>(2) manipule la «\\ liste de surveillance\\ » associée à "
130 "une instance inotify. Chaque élément («\\ watch\\ ») de la liste de "
131 "surveillance indique le chemin d'un fichier ou d'un répertoire, avec un "
132 "ensemble d'événements que le noyau doit surveiller pour le fichier indiqué "
133 "par ce chemin. B<inotify_add_watch>(2) crée un nouvel élément de "
134 "surveillance ou modifie un élément existant. Chaque élément a un unique «\\ "
135 "descripteur de surveillance\\ », un entier renvoyé par "
136 "B<inotify_add_watch>(2) lorsque cet élément est créé."
137
138 #. type: Plain text
139 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
140 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
141 msgid ""
142 "When events occur for monitored files and directories, those events are made "
143 "available to the application as structured data that can be read from the "
144 "inotify file descriptor using B<read>(2) (see below)."
145 msgstr ""
146 "Quand les événements ont lieu pour des fichiers et répertoires surveillés, "
147 "ces événements sont rendus disponibles à l’application comme des données "
148 "structurées qui peuvent être lues depuis le descripteur de fichier inotify "
149 "en utilisant B<read>(2) (voir plus bas)."
150
151 #. type: Plain text
152 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
153 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
154 msgid "B<inotify_rm_watch>(2) removes an item from an inotify watch list."
155 msgstr ""
156 "B<inotify_rm_watch>(2) retire un élément d'une liste de surveillance inotify."
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 "When all file descriptors referring to an inotify instance have been closed "
163 "(using B<close>(2)), the underlying object and its resources are freed for "
164 "reuse by the kernel; all associated watches are automatically freed."
165 msgstr ""
166 "Quand tous les descripteurs de fichier se référant à une instance inotify "
167 "ont été fermés (en utilisant B<close>(2)), l'objet sous-jacent et ses "
168 "ressources sont libérés pour être réutilisés par le noyau\\ ; tous les "
169 "éléments de surveillance associés sont automatiquement libérés."
170
171 #. type: Plain text
172 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
173 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
174 msgid ""
175 "With careful programming, an application can use inotify to efficiently "
176 "monitor and cache the state of a set of filesystem objects. However, robust "
177 "applications should allow for the fact that bugs in the monitoring logic or "
178 "races of the kind described below may leave the cache inconsistent with the "
179 "filesystem state. It is probably wise to do some consistency checking, and "
180 "rebuild the cache when inconsistencies are detected."
181 msgstr ""
182 "Avec une programmation prudente, une application peut utiliser inotify pour "
183 "surveiller et mettre en cache efficacement l’état d’un ensemble d’objets de "
184 "système de fichiers. Cependant, les applications robustes devraient prendre "
185 "en compte que des bogues dans la logique de surveillance ou des situations "
186 "de compétition du type décrit ci-dessous pourraient laisser le cache "
187 "incohérent avec l’état du système de fichiers. Réaliser des vérifications de "
188 "cohérence et reconstruire le cache en cas de détection d’incohérences serait "
189 "sans doute sage."
190
191 #. type: SS
192 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
193 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
194 #, no-wrap
195 msgid "Reading events from an inotify file descriptor"
196 msgstr "Lecture d’événements d’un descripteur de fichier inotify"
197
198 #. type: Plain text
199 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
200 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
201 msgid ""
202 "To determine what events have occurred, an application B<read>(2)s from the "
203 "inotify file descriptor. If no events have so far occurred, then, assuming "
204 "a blocking file descriptor, B<read>(2) will block until at least one event "
205 "occurs (unless interrupted by a signal, in which case the call fails with "
206 "the error B<EINTR>; see B<signal>(7))."
207 msgstr ""
208 "Pour déterminer quels événements ont eu lieu, une application va lire avec "
209 "B<read>(2) le descripteur de fichier inotify. Si aucun événement n'a eu "
210 "lieu, alors, en supposant qu'il s'agisse d'un descripteur de fichier "
211 "bloquant, B<read>(2) se bloquera jusqu'à ce qu'au moins un événement ait "
212 "lieu (à moins qu'elle ne soit interrompue par un signal, auquel cas l'appel "
213 "échouera avec l'erreur B<EINTR> ; consultez B<signal>(7))."
214
215 #. type: Plain text
216 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
217 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
218 msgid ""
219 "Each successful B<read>(2) returns a buffer containing one or more of the "
220 "following structures:"
221 msgstr ""
222 "Chaque lecture (avec B<read>(2)) réussie renvoie un tampon contenant une ou "
223 "plusieurs des structures suivantes\\ :"
224
225 #. FIXME . The type of the 'wd' field should probably be "int32_t".
226 #. I submitted a patch to fix this. See the LKML thread
227 #. "[patch] Fix type errors in inotify interfaces", 18 Nov 2008
228 #. glibc bug filed: https://www.sourceware.org/bugzilla/show_bug.cgi?id=7040
229 #. type: Plain text
230 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
231 #: opensuse-tumbleweed
232 #, fuzzy, no-wrap
233 #| msgid ""
234 #| "struct inotify_event {\n"
235 #| " int wd; /* Watch descriptor */\n"
236 #| " uint32_t mask; /* Mask describing event */\n"
237 #| " uint32_t cookie; /* Unique cookie associating related\n"
238 #| " events (for rename(2)) */\n"
239 #| " uint32_t len; /* Size of I<name> field */\n"
240 #| " char name[]; /* Optional null-terminated name */\n"
241 #| "};\n"
242 msgid ""
243 "struct inotify_event {\n"
244 " int wd; /* Watch descriptor */\n"
245 " uint32_t mask; /* Mask describing event */\n"
246 " uint32_t cookie; /* Unique cookie associating related\n"
247 " events (for rename(2)) */\n"
248 " uint32_t len; /* Size of \\f[I]name\\fR field */\n"
249 " char name[]; /* Optional null-terminated name */\n"
250 "};\n"
251 msgstr ""
252 "struct inotify_event {\n"
253 " int wd; /* Descripteur de surveillance */\n"
254 " uint32_t mask; /* Masque décrivant l’événement */\n"
255 " uint32_t cookie; /* Cookie unique d'association des\n"
256 " événements (pour rename(2)) */\n"
257 " uint32_t len; /* Taille du champ I<name> */\n"
258 " char name[]; /* Nom optionnel terminé par un nul */\n"
259 "};\n"
260
261 #. type: Plain text
262 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
263 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
264 msgid ""
265 "I<wd> identifies the watch for which this event occurs. It is one of the "
266 "watch descriptors returned by a previous call to B<inotify_add_watch>(2)."
267 msgstr ""
268 "I<wd> identifie l'élément de surveillance pour lequel cet événement a lieu. "
269 "Il s'agit de l'un des descripteurs de surveillance renvoyés par un précédent "
270 "appel à B<inotify_add_watch>(2)."
271
272 #. type: Plain text
273 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
274 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
275 msgid ""
276 "I<mask> contains bits that describe the event that occurred (see below)."
277 msgstr ""
278 "I<mask> contient des bits qui décrivent l'événement qui a eu lieu (voir ci-"
279 "dessous)."
280
281 #. type: Plain text
282 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
283 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
284 msgid ""
285 "I<cookie> is a unique integer that connects related events. Currently, this "
286 "is used only for rename events, and allows the resulting pair of "
287 "B<IN_MOVED_FROM> and B<IN_MOVED_TO> events to be connected by the "
288 "application. For all other event types, I<cookie> is set to 0."
289 msgstr ""
290 "I<cookie> est un entier unique qui relie les événements. Ce n'est "
291 "actuellement utilisé que pour les événements de renommage, et permet à la "
292 "paire d'événements B<IN_MOVED_FROM> et B<IN_MOVED_TO> en résultant d'être "
293 "associée par l'application. Pour tous les autres types d'événements, "
294 "I<cookie> est mis à 0."
295
296 #. type: Plain text
297 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
298 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
299 msgid ""
300 "The I<name> field is present only when an event is returned for a file "
301 "inside a watched directory; it identifies the filename within the watched "
302 "directory. This filename is null-terminated, and may include further null "
303 "bytes (\\[aq]\\[rs]0\\[aq]) to align subsequent reads to a suitable address "
304 "boundary."
305 msgstr ""
306 "Le champ I<name> n'est présent que lorsqu'un événement est renvoyé pour un "
307 "fichier au sein d'un répertoire surveillé. Il identifie le chemin du fichier "
308 "dans le répertoire surveillé. Ce chemin est terminé par un caractère NULL et "
309 "peut inclure d'autres octets nuls («\\ \\[rs]0\\ ») pour ajuster des "
310 "lectures successives à une limite d'adressage convenable."
311
312 #. type: Plain text
313 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
314 #: opensuse-leap-16-1 opensuse-tumbleweed
315 msgid ""
316 "The I<len> field counts all of the bytes in I<name>, including the null "
317 "bytes; the size of each I<inotify_event> structure is thus I<sizeof(struct "
318 "inotify_event)+size>."
319 msgstr ""
320 "Le champ I<len> compte tous les octets de I<name>, incluant les caractères "
321 "nuls. La taille de chaque structure I<inotify_event> vaut donc "
322 "I<sizeof(structinotify_event)+size>."
323
324 #. type: Plain text
325 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
326 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
327 msgid ""
328 "The behavior when the buffer given to B<read>(2) is too small to return "
329 "information about the next event depends on the kernel version: before Linux "
330 "2.6.21, B<read>(2) returns 0; since Linux 2.6.21, B<read>(2) fails with "
331 "the error B<EINVAL>. Specifying a buffer of size"
332 msgstr ""
333 "Le comportement, lorsque le tampon donné à B<read>(2) est trop petit pour "
334 "renvoyer l'information sur le prochain événement, dépend de la version du "
335 "noyau\\ : avant Linux 2.6.21, B<read>(2) renvoie B<0> ; depuis Linux 2.6.21, "
336 "B<read>(2) échoue avec l'erreur B<EINVAL>. Indiquer un tampon de taille"
337
338 #. type: Plain text
339 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
340 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
341 #, no-wrap
342 msgid "sizeof(struct inotify_event) + NAME_MAX + 1\n"
343 msgstr "sizeof(struct inotify_event) + NAME_MAX + 1\n"
344
345 #. type: Plain text
346 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
347 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
348 msgid "will be sufficient to read at least one event."
349 msgstr "est suffisant pour lire au moins un événement."
350
351 #. type: SS
352 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
353 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
354 #, no-wrap
355 msgid "inotify events"
356 msgstr "Événements inotify"
357
358 #. type: Plain text
359 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
360 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
361 msgid ""
362 "The B<inotify_add_watch>(2) I<mask> argument and the I<mask> field of the "
363 "I<inotify_event> structure returned when B<read>(2)ing an inotify file "
364 "descriptor are both bit masks identifying inotify events. The following "
365 "bits can be specified in I<mask> when calling B<inotify_add_watch>(2) and "
366 "may be returned in the I<mask> field returned by B<read>(2):"
367 msgstr ""
368 "L'argument I<mask> passé à B<inotify_add_watch>(2) et le champ I<mask> de la "
369 "structure I<inotify_event> renvoyés lors de la lecture avec B<read>(2) d'un "
370 "descripteur de fichier inotify sont tous deux des masques binaires "
371 "identifiant les événements inotify. Les bits suivants peuvent être définis "
372 "dans l'argument I<mask> lors de l'appel à B<inotify_add_watch>(2) et peuvent "
373 "être renvoyés dans le champ I<mask> renvoyé par B<read>(2)."
374
375 #. type: TP
376 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
377 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
378 #, no-wrap
379 msgid "B<IN_ACCESS> (+)"
380 msgstr "B<IN_ACCESS> (+)"
381
382 #. type: Plain text
383 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
384 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
385 msgid "File was accessed (e.g., B<read>(2), B<execve>(2))."
386 msgstr "Accès au fichier (par exemple B<read>(2), B<execve>(2))."
387
388 #. type: TP
389 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
390 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
391 #, no-wrap
392 msgid "B<IN_ATTRIB> (*)"
393 msgstr "B<IN_ATTRIB> (*)"
394
395 #. #-#-#-#-# archlinux: inotify.7.pot (PACKAGE VERSION) #-#-#-#-#
396 #. FIXME .
397 #. Events do not occur for link count changes on a file inside a monitored
398 #. directory. This differs from other metadata changes for files inside
399 #. a monitored directory.
400 #. type: Plain text
401 #. #-#-#-#-# debian-trixie: inotify.7.pot (PACKAGE VERSION) #-#-#-#-#
402 #. FIXME .
403 #. Events do not occur for link count changes on a file inside a monitored
404 #. directory. This differs from other metadata changes for files inside
405 #. a monitored directory.
406 #. type: Plain text
407 #. #-#-#-#-# debian-unstable: inotify.7.pot (PACKAGE VERSION) #-#-#-#-#
408 #. FIXME .
409 #. Events do not occur for link count changes on a file inside a monitored
410 #. directory. This differs from other metadata changes for files inside
411 #. a monitored directory.
412 #. type: Plain text
413 #. #-#-#-#-# fedora-44: inotify.7.pot (PACKAGE VERSION) #-#-#-#-#
414 #. FIXME .
415 #. Events do not occur for link count changes on a file inside a monitored
416 #. directory. This differs from other metadata changes for files inside
417 #. a monitored directory.
418 #. type: Plain text
419 #. #-#-#-#-# fedora-rawhide: inotify.7.pot (PACKAGE VERSION) #-#-#-#-#
420 #. FIXME .
421 #. Events do not occur for link count changes on a file inside a monitored
422 #. directory. This differs from other metadata changes for files inside
423 #. a monitored directory.
424 #. type: Plain text
425 #. #-#-#-#-# mageia-cauldron: inotify.7.pot (PACKAGE VERSION) #-#-#-#-#
426 #. FIXME .
427 #. Events do not occur for link count changes on a file inside a monitored
428 #. directory. This differs from other metadata changes for files inside
429 #. a monitored directory.
430 #. type: Plain text
431 #. #-#-#-#-# opensuse-leap-16-1: inotify.7.pot (PACKAGE VERSION) #-#-#-#-#
432 #. FIXME .
433 #. Events do not occur for link count changes on a file inside a monitored
434 #. directory. This differs from other metadata changes for files inside
435 #. a monitored directory.
436 #. type: Plain text
437 #. #-#-#-#-# opensuse-tumbleweed: inotify.7.pot (PACKAGE VERSION) #-#-#-#-#
438 #. FIXME .
439 #. Events do not occur for link count changes on a file inside a monitored
440 #. directory. This differs from other metadata changes for files inside
441 #. a monitored directory.
442 #. type: Plain text
443 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
444 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
445 msgid ""
446 "Metadata changed\\[em]for example, permissions (e.g., B<chmod>(2)), "
447 "timestamps (e.g., B<utimensat>(2)), extended attributes (B<setxattr>(2)), "
448 "link count (since Linux 2.6.25; e.g., for the target of B<link>(2) and for "
449 "B<unlink>(2)), and user/group ID (e.g., B<chown>(2))."
450 msgstr ""
451 "Modification des métadonnées, par exemple, les permissions (par exemple "
452 "B<chmod>(2)), les horodatages (par exemple B<utimensat>(2)), les attributs "
453 "étendus (B<setxattr>(2)), le compteur de liens (depuis Linux 2.6.25 ; par "
454 "exemple pour la cible de B<link>(2) et B<unlink>(2)) et les UID ou GID (par "
455 "exemple B<chown>(2))."
456
457 #. type: TP
458 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
459 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
460 #, no-wrap
461 msgid "B<IN_CLOSE_WRITE> (+)"
462 msgstr "B<IN_CLOSE_WRITE> (+)"
463
464 #. type: Plain text
465 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
466 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
467 msgid "File opened for writing was closed."
468 msgstr "Fichier ouvert en écriture fermé."
469
470 #. type: TP
471 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
472 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
473 #, no-wrap
474 msgid "B<IN_CLOSE_NOWRITE> (*)"
475 msgstr "B<IN_CLOSE_NOWRITE> (*)"
476
477 #. type: Plain text
478 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
479 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
480 msgid "File or directory not opened for writing was closed."
481 msgstr "Fichier ou répertoire non ouverts en écriture fermés."
482
483 #. type: TP
484 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
485 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
486 #, no-wrap
487 msgid "B<IN_CREATE> (+)"
488 msgstr "B<IN_CREATE> (+)"
489
490 #. type: Plain text
491 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
492 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
493 msgid ""
494 "File/directory created in watched directory (e.g., B<open>(2) B<O_CREAT>, "
495 "B<mkdir>(2), B<link>(2), B<symlink>(2), B<bind>(2) on a UNIX domain socket)."
496 msgstr ""
497 "Fichier ou répertoire créés dans le répertoire surveillé (par exemple "
498 "B<open>(2) B<O_CREAT>, B<mkdir>(2), B<link>(2), B<symlink>(2), B<bind>(2) "
499 "sur un socket de domaine UNIX)."
500
501 #. type: TP
502 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
503 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
504 #, no-wrap
505 msgid "B<IN_DELETE> (+)"
506 msgstr "B<IN_DELETE> (+)"
507
508 #. type: Plain text
509 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
510 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
511 msgid "File/directory deleted from watched directory."
512 msgstr "Fichier ou répertoire supprimés dans le répertoire surveillé."
513
514 #. type: TP
515 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
516 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
517 #, no-wrap
518 msgid "B<IN_DELETE_SELF>"
519 msgstr "B<IN_DELETE_SELF>"
520
521 #. type: Plain text
522 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
523 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
524 msgid ""
525 "Watched file/directory was itself deleted. (This event also occurs if an "
526 "object is moved to another filesystem, since B<mv>(1) in effect copies the "
527 "file to the other filesystem and then deletes it from the original "
528 "filesystem.) In addition, an B<IN_IGNORED> event will subsequently be "
529 "generated for the watch descriptor."
530 msgstr ""
531 "Fichier ou répertoire surveillés supprimés (cet événement se produit "
532 "également si un objet est déplacé vers un autre système de fichiers, puisque "
533 "B<mv>(1) copie effectivement le fichier vers l’autre système de fichiers "
534 "puis le supprime du système de fichiers d’origine). De plus, un événement "
535 "B<IN_IGNORED> sera ensuite généré pour le descripteur de surveillance."
536
537 #. type: TP
538 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
539 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
540 #, no-wrap
541 msgid "B<IN_MODIFY> (+)"
542 msgstr "B<IN_MODIFY> (+)"
543
544 #. type: Plain text
545 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
546 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
547 msgid "File was modified (e.g., B<write>(2), B<truncate>(2))."
548 msgstr "Fichier modifié (par exemple B<write>(2), B<truncate>(2))."
549
550 #. type: TP
551 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
552 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
553 #, no-wrap
554 msgid "B<IN_MOVE_SELF>"
555 msgstr "B<IN_MOVE_SELF>"
556
557 #. type: Plain text
558 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
559 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
560 msgid "Watched file/directory was itself moved."
561 msgstr "Fichier ou répertoire surveillés déplacés."
562
563 #. type: TP
564 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
565 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
566 #, no-wrap
567 msgid "B<IN_MOVED_FROM> (+)"
568 msgstr "B<IN_MOVED_FROM> (+)"
569
570 #. type: Plain text
571 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
572 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
573 msgid ""
574 "Generated for the directory containing the old filename when a file is "
575 "renamed."
576 msgstr ""
577 "Généré pour le répertoire contenant l'ancien nom quand un fichier est "
578 "renommé."
579
580 #. type: TP
581 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
582 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
583 #, no-wrap
584 msgid "B<IN_MOVED_TO> (+)"
585 msgstr "B<IN_MOVED_TO> (+)"
586
587 #. type: Plain text
588 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
589 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
590 msgid ""
591 "Generated for the directory containing the new filename when a file is "
592 "renamed."
593 msgstr ""
594 "Généré pour le répertoire contenant le nouveau nom quand un fichier est "
595 "renommé."
596
597 #. type: TP
598 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
599 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
600 #, no-wrap
601 msgid "B<IN_OPEN> (*)"
602 msgstr "B<IN_OPEN> (*)"
603
604 #. type: Plain text
605 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
606 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
607 msgid "File or directory was opened."
608 msgstr "Fichier ou répertoire ouvert."
609
610 #. type: Plain text
611 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
612 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
613 msgid ""
614 "Inotify monitoring is inode-based: when monitoring a file (but not when "
615 "monitoring the directory containing a file), an event can be generated for "
616 "activity on any link to the file (in the same or a different directory)."
617 msgstr ""
618 "La surveillance par Inotify est basée sur les inodes : lorsqu'un fichier est "
619 "surveillé (mais pas lors de la surveillance d'un répertoire contenant un "
620 "fichier), un événement peut être créé sur tout lien vers le fichier (dans le "
621 "même répertoire ou dans un répertoire différent)."
622
623 #. type: Plain text
624 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
625 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
626 msgid "When monitoring a directory:"
627 msgstr "Lors de la surveillance d'un répertoire :"
628
629 #. type: Plain text
630 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
631 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
632 msgid ""
633 "the events marked above with an asterisk (*) can occur both for the "
634 "directory itself and for objects inside the directory; and"
635 msgstr ""
636 "les événements marqués précédemment par un astérisque (*) peuvent avoir lieu "
637 "à la fois pour le répertoire et pour les objets à l’intérieur du répertoire ;"
638
639 #. type: Plain text
640 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
641 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
642 msgid ""
643 "the events marked with a plus sign (+) occur only for objects inside the "
644 "directory (not for the directory itself)."
645 msgstr ""
646 "les événements marqués par un signe plus (+) n’ont lieu que pour les objets "
647 "à l’intérieur du répertoire (et non pour le répertoire lui-même)."
648
649 #. type: Plain text
650 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
651 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
652 msgid ""
653 "I<Note>: when monitoring a directory, events are not generated for the files "
654 "inside the directory when the events are performed via a pathname (i.e., a "
655 "link) that lies outside the monitored directory."
656 msgstr ""
657 "I<Note> : lorsqu'un répertoire est surveillé, les événements ne sont pas "
658 "créés pour les fichiers contenus dans le répertoire quand des événements "
659 "sont exécutés avec un nom de chemin (par exemple, un lien) qui se trouve "
660 "hors du répertoire surveillé."
661
662 #. type: Plain text
663 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
664 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
665 msgid ""
666 "When events are generated for objects inside a watched directory, the "
667 "I<name> field in the returned I<inotify_event> structure identifies the name "
668 "of the file within the directory."
669 msgstr ""
670 "Lorsque les événements sont créés pour les objets dans un répertoire "
671 "surveillé, le champ I<name> dans la structure I<inotify_event> renvoyée "
672 "identifie le nom du fichier dans ce répertoire."
673
674 #. type: Plain text
675 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
676 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
677 msgid ""
678 "The B<IN_ALL_EVENTS> macro is defined as a bit mask of all of the above "
679 "events. This macro can be used as the I<mask> argument when calling "
680 "B<inotify_add_watch>(2)."
681 msgstr ""
682 "La macro B<IN_ALL_EVENTS> est définie comme un masque binaire de tous les "
683 "événements décrits ci-dessus. Cette macro peut être utilisée comme "
684 "l'argument I<mask> lors de l'appel à B<inotify_add_watch>(2)."
685
686 #. type: Plain text
687 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
688 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
689 msgid "Two additional convenience macros are defined:"
690 msgstr "Deux macros supplémentaires de convenance sont définies :"
691
692 #. type: TP
693 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
694 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
695 #, no-wrap
696 msgid "B<IN_MOVE>"
697 msgstr "B<IN_MOVE>"
698
699 #. type: Plain text
700 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
701 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
702 msgid "Equates to B<IN_MOVED_FROM | IN_MOVED_TO>."
703 msgstr "Équivalent à B<IN_MOVED_FROM | IN_MOVED_TO>."
704
705 #. type: TP
706 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
707 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
708 #, no-wrap
709 msgid "B<IN_CLOSE>"
710 msgstr "B<IN_CLOSE>"
711
712 #. type: Plain text
713 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
714 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
715 msgid "Equates to B<IN_CLOSE_WRITE | IN_CLOSE_NOWRITE>."
716 msgstr "Équivalent à B<IN_CLOSE_WRITE | IN_CLOSE_NOWRITE>."
717
718 #. type: Plain text
719 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
720 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
721 msgid ""
722 "The following further bits can be specified in I<mask> when calling "
723 "B<inotify_add_watch>(2):"
724 msgstr ""
725 "Les bits supplémentaires suivants peuvent être indiqués dans l'argument "
726 "I<mask> lors de l'appel à B<inotify_add_watch>(2)\\ :"
727
728 #. type: TP
729 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
730 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
731 #, no-wrap
732 msgid "B<IN_DONT_FOLLOW> (since Linux 2.6.15)"
733 msgstr "B<IN_DONT_FOLLOW> (depuis Linux 2.6.15)"
734
735 #. type: Plain text
736 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
737 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
738 msgid "Don't dereference I<pathname> if it is a symbolic link."
739 msgstr "Ne pas déréférencer I<chemin> s'il s'agit d'un lien symbolique."
740
741 #. type: TP
742 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
743 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
744 #, no-wrap
745 msgid "B<IN_EXCL_UNLINK> (since Linux 2.6.36)"
746 msgstr "B<IN_EXCL_UNLINK> (depuis Linux 2.6.36)"
747
748 #. commit 8c1934c8d70b22ca8333b216aec6c7d09fdbd6a6
749 #. type: Plain text
750 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
751 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
752 msgid ""
753 "By default, when watching events on the children of a directory, events are "
754 "generated for children even after they have been unlinked from the "
755 "directory. This can result in large numbers of uninteresting events for "
756 "some applications (e.g., if watching I</tmp>, in which many applications "
757 "create temporary files whose names are immediately unlinked). Specifying "
758 "B<IN_EXCL_UNLINK> changes the default behavior, so that events are not "
759 "generated for children after they have been unlinked from the watched "
760 "directory."
761 msgstr ""
762 "Par défaut, lors de la surveillance d'événements sur les entrées d'un "
763 "répertoire, des événements sont créés pour ces entrées même après leur "
764 "suppression du répertoire. De nombreux événements inintéressants pour "
765 "certaines applications peuvent ainsi être créés (par exemple, lors de la "
766 "surveillance de I</tmp>, où de nombreuses applications créent des fichiers "
767 "temporaires donc les noms sont immédiatement supprimés). Indiquer "
768 "B<IN_EXCL_UNLINK> modifie le comportement par défaut, de telle sorte "
769 "qu'aucun événement n'est créé pour ces entrées après leur suppression du "
770 "répertoire surveillé."
771
772 #. type: TP
773 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
774 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
775 #, no-wrap
776 msgid "B<IN_MASK_ADD>"
777 msgstr "B<IN_MASK_ADD>"
778
779 #. type: Plain text
780 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
781 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
782 msgid ""
783 "If a watch instance already exists for the filesystem object corresponding "
784 "to I<pathname>, add (OR) the events in I<mask> to the watch mask (instead of "
785 "replacing the mask); the error B<EINVAL> results if B<IN_MASK_CREATE> is "
786 "also specified."
787 msgstr ""
788 "Si une instance de surveillance existe déjà pour l’objet de système de "
789 "fichiers correspondant à I<chemin>, ajouter (avec un OU binaire) les "
790 "événements de I<mask> au masque de surveillance (au lieu de remplacer le "
791 "masque) ; il résulte une erreur B<EINVAL> si B<IN_MASK_CREATE> est aussi "
792 "spécifié."
793
794 #. type: TP
795 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
796 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
797 #, no-wrap
798 msgid "B<IN_ONESHOT>"
799 msgstr "B<IN_ONESHOT>"
800
801 #. type: Plain text
802 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
803 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
804 msgid ""
805 "Monitor the filesystem object corresponding to I<pathname> for one event, "
806 "then remove from watch list."
807 msgstr ""
808 "Surveiller l’objet de système de fichiers correspondant à I<chemin> jusqu'au "
809 "premier événement, puis le supprimer de la liste de surveillance."
810
811 #. type: TP
812 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
813 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
814 #, no-wrap
815 msgid "B<IN_ONLYDIR> (since Linux 2.6.15)"
816 msgstr "B<IN_ONLYDIR> (depuis Linux 2.6.15)"
817
818 #. type: Plain text
819 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
820 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
821 msgid ""
822 "Watch I<pathname> only if it is a directory; the error B<ENOTDIR> results if "
823 "I<pathname> is not a directory. Using this flag provides an application "
824 "with a race-free way of ensuring that the monitored object is a directory."
825 msgstr ""
826 "Surveiller I<chemin> seulement s'il s'agit d'un répertoire ; il résulte une "
827 "erreur B<ENOTDIR> si I<chemin> n'est pas un répertoire. Utiliser cet "
828 "attribut fournit à une application un moyen sans problème de concurrence de "
829 "s'assurer qu'un objet surveillé est un répertoire."
830
831 #. type: TP
832 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
833 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
834 #, no-wrap
835 msgid "B<IN_MASK_CREATE> (since Linux 4.18)"
836 msgstr "B<IN_MASK_CREATE> (depuis Linux 4.18)"
837
838 #. type: Plain text
839 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
840 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
841 msgid ""
842 "Watch I<pathname> only if it does not already have a watch associated with "
843 "it; the error B<EEXIST> results if I<pathname> is already being watched."
844 msgstr ""
845 "Surveiller I<chemin> seulement s'il n'y a pas déjà une surveillance qui lui "
846 "est associée ; il résulte une erreur B<EEXIST> si I<chemin> est déjà "
847 "surveillé."
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 "Utiliser cet attribut fournit à une application un moyen de s'assurer que de "
859 "nouveaux éléments de surveillance ne modifient pas ceux qui existent déjà. "
860 "C'est utile parce que plusieurs chemins peuvent faire référence au même "
861 "inœud et plusieurs appels à B<inotify_add_watch>(2) sans cet attribut "
862 "peuvent écraser des masques de surveillance existants."
863
864 #. type: Plain text
865 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
866 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
867 msgid ""
868 "The following bits may be set in the I<mask> field returned by B<read>(2):"
869 msgstr ""
870 "Les bits suivants peuvent avoir été définis dans le champ I<mask> renvoyé "
871 "par B<read>(2)\\ :"
872
873 #. type: TP
874 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
875 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
876 #, no-wrap
877 msgid "B<IN_IGNORED>"
878 msgstr "B<IN_IGNORED>"
879
880 #. type: Plain text
881 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
882 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
883 msgid ""
884 "Watch was removed explicitly (B<inotify_rm_watch>(2)) or automatically "
885 "(file was deleted, or filesystem was unmounted). See also BUGS."
886 msgstr ""
887 "Le surveillant a été retiré explicitement (B<inotify_rm_watch>(2)) ou "
888 "automatiquement (le fichier a été effacé, ou le système de fichiers a été "
889 "démonté). Consultez également B<BOGUES>."
890
891 #. type: TP
892 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
893 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
894 #, no-wrap
895 msgid "B<IN_ISDIR>"
896 msgstr "B<IN_ISDIR>"
897
898 #. type: Plain text
899 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
900 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
901 msgid "Subject of this event is a directory."
902 msgstr "Le sujet de cet événement est un répertoire."
903
904 #. type: TP
905 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
906 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
907 #, no-wrap
908 msgid "B<IN_Q_OVERFLOW>"
909 msgstr "B<IN_Q_OVERFLOW>"
910
911 #. type: Plain text
912 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
913 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
914 msgid "Event queue overflowed (I<wd> is -1 for this event)."
915 msgstr "Queue des événements surchargée (I<wd> vaut alors -1)."
916
917 #. type: TP
918 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
919 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
920 #, no-wrap
921 msgid "B<IN_UNMOUNT>"
922 msgstr "B<IN_UNMOUNT>"
923
924 #. type: Plain text
925 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
926 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
927 msgid ""
928 "Filesystem containing watched object was unmounted. In addition, an "
929 "B<IN_IGNORED> event will subsequently be generated for the watch descriptor."
930 msgstr ""
931 "Le système de fichiers contenant l'objet surveillé a été démonté. De plus, "
932 "un événement B<IN_IGNORED> sera ensuite généré pour le descripteur de "
933 "surveillance."
934
935 #. type: SS
936 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
937 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
938 #, no-wrap
939 msgid "Examples"
940 msgstr "Exemples"
941
942 #. type: Plain text
943 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
944 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
945 msgid ""
946 "Suppose an application is watching the directory I<dir> and the file I<dir/"
947 "myfile> for all events. The examples below show some events that will be "
948 "generated for these two objects."
949 msgstr ""
950 "Soit une application surveillant le répertoire I<rép> et le fichier I<rép/"
951 "monfichier> pour tous les événements. Les exemples ci-dessous montrent "
952 "quelques événements qui seront générés pour ces deux objets."
953
954 #. type: TP
955 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
956 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
957 #, no-wrap
958 msgid "fd = open(\"dir/myfile\", O_RDWR);"
959 msgstr "fd = open(\"rép/monfichier\", O_RDWR);"
960
961 #. type: Plain text
962 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
963 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
964 msgid "Generates B<IN_OPEN> events for both I<dir> and I<dir/myfile>."
965 msgstr ""
966 "Génère des événements B<IN_OPEN> à la fois pour I<rép> et I<rép/monfichier>."
967
968 #. type: TP
969 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
970 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
971 #, no-wrap
972 msgid "read(fd, buf, count);"
973 msgstr "read(fd, buf, count);"
974
975 #. type: Plain text
976 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
977 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
978 msgid "Generates B<IN_ACCESS> events for both I<dir> and I<dir/myfile>."
979 msgstr ""
980 "Génère des événements B<IN_ACCESS> à la fois pour I<rép> et I<rép/"
981 "monfichier>."
982
983 #. type: TP
984 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
985 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
986 #, no-wrap
987 msgid "write(fd, buf, count);"
988 msgstr "write(fd, buf, count);"
989
990 #. type: Plain text
991 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
992 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
993 msgid "Generates B<IN_MODIFY> events for both I<dir> and I<dir/myfile>."
994 msgstr ""
995 "Génère des événements B<IN_MODIFY> à la fois pour I<rép> et I<rép/"
996 "monfichier>."
997
998 #. type: TP
999 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1000 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1001 #, no-wrap
1002 msgid "fchmod(fd, mode);"
1003 msgstr "fchmod(fd, mode);"
1004
1005 #. type: Plain text
1006 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1007 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1008 msgid "Generates B<IN_ATTRIB> events for both I<dir> and I<dir/myfile>."
1009 msgstr ""
1010 "Génère des événements B<IN_ATTRIB> à la fois pour I<rép> et I<rép/"
1011 "monfichier>."
1012
1013 #. type: TP
1014 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1015 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1016 #, no-wrap
1017 msgid "close(fd);"
1018 msgstr "close(fd);"
1019
1020 #. type: Plain text
1021 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1022 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1023 msgid "Generates B<IN_CLOSE_WRITE> events for both I<dir> and I<dir/myfile>."
1024 msgstr ""
1025 "Génère des événements B<IN_CLOSE_WRITE> à la fois pour I<rép> et I<rép/"
1026 "monfichier>."
1027
1028 #. type: Plain text
1029 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1030 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1031 msgid ""
1032 "Suppose an application is watching the directories I<dir1> and I<dir2>, and "
1033 "the file I<dir1/myfile>. The following examples show some events that may "
1034 "be generated."
1035 msgstr ""
1036 "Soit une application surveillant les répertoires I<rép1> et I<rép2>, et le "
1037 "fichier I<rép1/monfichier>. Les exemples suivants montrent quelques "
1038 "événements qui pourraient être générés."
1039
1040 #. type: TP
1041 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1042 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1043 #, no-wrap
1044 msgid "link(\"dir1/myfile\", \"dir2/new\");"
1045 msgstr "link(\"rép1/monfichier\", \"rép2/nouveau\");"
1046
1047 #. type: Plain text
1048 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1049 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1050 msgid ""
1051 "Generates an B<IN_ATTRIB> event for I<myfile> and an B<IN_CREATE> event for "
1052 "I<dir2>."
1053 msgstr ""
1054 "Génère un événement B<IN_ATTRIB> pour I<monfichier> et un événement "
1055 "B<IN_CREATE> pour I<rép2>."
1056
1057 #. type: TP
1058 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1059 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1060 #, no-wrap
1061 msgid "rename(\"dir1/myfile\", \"dir2/myfile\");"
1062 msgstr "rename(\"rép1/monfichier\", \"rép2/monfichier\");"
1063
1064 #. type: Plain text
1065 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1066 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1067 msgid ""
1068 "Generates an B<IN_MOVED_FROM> event for I<dir1>, an B<IN_MOVED_TO> event for "
1069 "I<dir2>, and an B<IN_MOVE_SELF> event for I<myfile>. The B<IN_MOVED_FROM> "
1070 "and B<IN_MOVED_TO> events will have the same I<cookie> value."
1071 msgstr ""
1072 "Génère un événement B<IN_MOVED_FROM> pour I<dir1>, un événement "
1073 "B<IN_MOVED_TO> pour I<rép2> et un événement B<IN_MOVE_SELF> pour "
1074 "I<monfichier>. Les événements B<IN_MOVED_FROM> et B<IN_MOVED_TO> auront la "
1075 "même valeur I<cookie>."
1076
1077 #. type: Plain text
1078 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1079 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1080 msgid ""
1081 "Suppose that I<dir1/xx> and I<dir2/yy> are (the only) links to the same "
1082 "file, and an application is watching I<dir1>, I<dir2>, I<dir1/xx>, and "
1083 "I<dir2/yy>. Executing the following calls in the order given below will "
1084 "generate the following events:"
1085 msgstr ""
1086 "Soient I<rép1/xx> et I<rép2/yy> les (seuls) liens vers le même ficher, et "
1087 "une application surveillant I<rép1>, I<rép2>, I<rép1/xx> et I<rép2/yy>. "
1088 "L’exécution des appels suivants dans l’ordre donné ci-dessous générera les "
1089 "événements suivants :"
1090
1091 #. type: TP
1092 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1093 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1094 #, no-wrap
1095 msgid "unlink(\"dir2/yy\");"
1096 msgstr "unlink(\"rép2/yy\");"
1097
1098 #. type: Plain text
1099 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1100 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1101 msgid ""
1102 "Generates an B<IN_ATTRIB> event for I<xx> (because its link count changes) "
1103 "and an B<IN_DELETE> event for I<dir2>."
1104 msgstr ""
1105 "Génère un événement B<IN_ATTRIB> pour I<xx> (à cause du changement de son "
1106 "compteur de liens) et un événement B<IN_DELETE> pour I<rép2>."
1107
1108 #. type: TP
1109 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1110 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1111 #, no-wrap
1112 msgid "unlink(\"dir1/xx\");"
1113 msgstr "unlink(\"rép1/xx\");"
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 "Generates B<IN_ATTRIB>, B<IN_DELETE_SELF>, and B<IN_IGNORED> events for "
1120 "I<xx>, and an B<IN_DELETE> event for I<dir1>."
1121 msgstr ""
1122 "Génère des événements B<IN_ATTRIB>, B<IN_DELETE_SELF> et B<IN_IGNORED> pour "
1123 "I<xx> et un événement B<IN_DELETE> pour I<rép1>."
1124
1125 #. type: Plain text
1126 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1127 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1128 msgid ""
1129 "Suppose an application is watching the directory I<dir> and (the empty) "
1130 "directory I<dir/subdir>. The following examples show some events that may "
1131 "be generated."
1132 msgstr ""
1133 "Soit une application surveillant le répertoire I<rép> et le répertoire "
1134 "(vide) I<rép/sousrép>. Les exemples suivants montrent quelques événements "
1135 "qui pourraient être générés."
1136
1137 #. type: TP
1138 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1139 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1140 #, no-wrap
1141 msgid "mkdir(\"dir/new\", mode);"
1142 msgstr "mkdir(\"rép/nouveau\", mode);"
1143
1144 #. type: Plain text
1145 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1146 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1147 msgid "Generates an B<IN_CREATE | IN_ISDIR> event for I<dir>."
1148 msgstr "Génère un événement B<IN_CREATE | IN_ISDIR> pour I<rép>."
1149
1150 #. type: TP
1151 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1152 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1153 #, no-wrap
1154 msgid "rmdir(\"dir/subdir\");"
1155 msgstr "rmdir(\"rép/sousrép\");"
1156
1157 #. type: Plain text
1158 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1159 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1160 msgid ""
1161 "Generates B<IN_DELETE_SELF> and B<IN_IGNORED> events for I<subdir>, and an "
1162 "B<IN_DELETE | IN_ISDIR> event for I<dir>."
1163 msgstr ""
1164 "Génère des événements B<IN_DELETE_SELF> et B<IN_IGNORED> pour I<sousrép> et "
1165 "un événement B<IN_DELETE | IN_ISDIR> pour I<rép>."
1166
1167 #. type: SS
1168 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1169 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1170 #, no-wrap
1171 msgid "/proc interfaces"
1172 msgstr "/proc interfaces"
1173
1174 #. type: Plain text
1175 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1176 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1177 msgid ""
1178 "The following interfaces can be used to limit the amount of kernel memory "
1179 "consumed by inotify:"
1180 msgstr ""
1181 "Les interfaces suivantes peuvent être utilisées pour limiter la quantité de "
1182 "mémoire du noyau utilisée par inotify\\ :"
1183
1184 #. type: TP
1185 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1186 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1187 #, no-wrap
1188 msgid "I</proc/sys/fs/inotify/max_queued_events>"
1189 msgstr "I</proc/sys/fs/inotify/max_queued_events>"
1190
1191 #. type: Plain text
1192 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1193 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1194 msgid ""
1195 "The value in this file is used when an application calls B<inotify_init>(2) "
1196 "to set an upper limit on the number of events that can be queued to the "
1197 "corresponding inotify instance. Events in excess of this limit are dropped, "
1198 "but an B<IN_Q_OVERFLOW> event is always generated."
1199 msgstr ""
1200 "La valeur dans ce fichier est utilisée lorsqu'une application appelle "
1201 "B<inotify_init>(2) pour définir la limite maximale du nombre des événements "
1202 "qui peuvent entrer dans la file d'attente de l'instance inotify "
1203 "correspondante. Les événements au-delà de cette limite sont annulés, mais un "
1204 "événement B<IN_Q_OVERFLOW> est systématiquement généré."
1205
1206 #. type: TP
1207 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1208 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1209 #, no-wrap
1210 msgid "I</proc/sys/fs/inotify/max_user_instances>"
1211 msgstr "I</proc/sys/fs/inotify/max_user_instances>"
1212
1213 #. type: Plain text
1214 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1215 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1216 msgid ""
1217 "This specifies an upper limit on the number of inotify instances that can be "
1218 "created per real user ID."
1219 msgstr ""
1220 "Cela indique la limite maximale du nombre d'instances inotify qui peuvent "
1221 "être créées par identifiant utilisateur réel."
1222
1223 #. type: TP
1224 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1225 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1226 #, no-wrap
1227 msgid "I</proc/sys/fs/inotify/max_user_watches>"
1228 msgstr "I</proc/sys/fs/inotify/max_user_watches>"
1229
1230 #. type: Plain text
1231 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1232 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1233 msgid ""
1234 "This specifies an upper limit on the number of watches that can be created "
1235 "per real user ID."
1236 msgstr ""
1237 "Cela indique la limite maximale du nombre de « watch » qui peuvent être "
1238 "créés par identifiant utilisateur réel."
1239
1240 #. type: SH
1241 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1242 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1243 #, no-wrap
1244 msgid "STANDARDS"
1245 msgstr "NORMES"
1246
1247 #. type: Plain text
1248 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1249 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1250 msgid "Linux."
1251 msgstr "Linux."
1252
1253 #. type: SH
1254 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1255 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1256 #, no-wrap
1257 msgid "HISTORY"
1258 msgstr "HISTORIQUE"
1259
1260 #. type: Plain text
1261 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1262 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1263 msgid ""
1264 "Inotify was merged into Linux 2.6.13. The required library interfaces were "
1265 "added in glibc 2.4. (B<IN_DONT_FOLLOW>, B<IN_MASK_ADD>, and B<IN_ONLYDIR> "
1266 "were added in glibc 2.5.)"
1267 msgstr ""
1268 "Inotify a été inclus dans Linux 2.6.13. Les interfaces bibliothèque "
1269 "nécessaires ont été ajoutées dans la glibc 2.4 (B<IN_DONT_FOLLOW>, "
1270 "B<IN_MASK_ADD> et B<IN_ONLYDIR> ont été ajoutées dans la glibc 2.5)."
1271
1272 #. type: SH
1273 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1274 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1275 #, no-wrap
1276 msgid "NOTES"
1277 msgstr "NOTES"
1278
1279 #. type: Plain text
1280 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1281 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1282 msgid ""
1283 "Inotify file descriptors can be monitored using B<select>(2), B<poll>(2), "
1284 "and B<epoll>(7). When an event is available, the file descriptor indicates "
1285 "as readable."
1286 msgstr ""
1287 "Les descripteurs de fichier inotify peuvent être surveillés en utilisant "
1288 "B<select>(2), B<poll>(2) et B<epoll>(7). Lorsqu'un événement est disponible, "
1289 "le descripteur de fichier indique qu'il est accessible en lecture."
1290
1291 #. type: Plain text
1292 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1293 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1294 msgid ""
1295 "Since Linux 2.6.25, signal-driven I/O notification is available for inotify "
1296 "file descriptors; see the discussion of B<F_SETFL> (for setting the "
1297 "B<O_ASYNC> flag), B<F_SETOWN>, and B<F_SETSIG> in B<fcntl>(2). The "
1298 "I<siginfo_t> structure (described in B<sigaction>(2)) that is passed to the "
1299 "signal handler has the following fields set: I<si_fd> is set to the inotify "
1300 "file descriptor number; I<si_signo> is set to the signal number; I<si_code> "
1301 "is set to B<POLL_IN>; and B<POLLIN> is set in I<si_band>."
1302 msgstr ""
1303 "Depuis Linux 2.6.25, il est possible d'être notifié par des signaux pour des "
1304 "entrées-sorties des descripteurs de fichier inotify ; consultez la "
1305 "discussion de B<F_SETFL> (pour la configuration de l'attribut B<O_ASYNC>), "
1306 "B<F_SETOWN>, et B<F_SETSIG> dans B<fcntl>(2). La structure I<siginfo_t> "
1307 "(décrite dans B<sigaction>(2)) qui est passée au gestionnaire de signal a "
1308 "les champs suivants définis : I<si_fd> est défini avec le numéro de "
1309 "descripteur de fichiers inotify ; I<si_signo> est défini avec le numéro du "
1310 "signal ; I<si_code> est défini avec B<POLL_IN> ; et I<si_band> est défini "
1311 "avec B<POLLIN>."
1312
1313 #. type: Plain text
1314 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1315 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1316 msgid ""
1317 "If successive output inotify events produced on the inotify file descriptor "
1318 "are identical (same I<wd>, I<mask>, I<cookie>, and I<name>), then they are "
1319 "coalesced into a single event if the older event has not yet been read (but "
1320 "see BUGS). This reduces the amount of kernel memory required for the event "
1321 "queue, but also means that an application can't use inotify to reliably "
1322 "count file events."
1323 msgstr ""
1324 "Si deux événements inotify de sortie successifs produits sur le descripteur "
1325 "de fichier inotify sont identiques (I<wd>, I<mask>, I<cookie>, et I<name> "
1326 "identiques), alors ils sont fusionnés en un seul événement si l'événement le "
1327 "plus ancien n'a toujours pas été lu (mais consultez la section BOGUES). Cela "
1328 "permet de réduire la quantité de mémoire en espace noyau nécessaire à la "
1329 "file d'événements, mais signifie également qu'une application ne peut "
1330 "utiliser inotify pour compter de manière fiable les événements liés à un "
1331 "fichier."
1332
1333 #. type: Plain text
1334 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1335 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1336 msgid ""
1337 "The events returned by reading from an inotify file descriptor form an "
1338 "ordered queue. Thus, for example, it is guaranteed that when renaming from "
1339 "one directory to another, events will be produced in the correct order on "
1340 "the inotify file descriptor."
1341 msgstr ""
1342 "Les événements renvoyés lors de la lecture d'un descripteur de fichier "
1343 "inotify forment une file ordonnée. Ainsi, par exemple, il est garanti que "
1344 "lors du renommage d'un répertoire, les événements seront produits dans "
1345 "l'ordre convenable sur le descripteur de fichier inotify."
1346
1347 #. type: Plain text
1348 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1349 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
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 "L'ensemble des descripteurs surveillés grâce à un descripteur de fichier "
1358 "inotify peut être vu dans l'entrée du descripteur de fichier inotify dans le "
1359 "répertoire I</proc/>pidI</fdinfo> du processus. Consultez B<proc>(5) pour de "
1360 "plus amples détails. B<FIONREAD> B<ioctl>(2) renvoie le nombre d'octets "
1361 "disponibles à la lecture dans un descripteur de fichier 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 "Limites et réserves"
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 "L'interface inotify ne fournit aucun renseignement sur l'utilisateur ou le "
1380 "processus qui a déclenché l'événement inotify. En particulier, un processus "
1381 "en train de surveiller des événements à l'aide d'inotify ne dispose d'aucun "
1382 "moyen facile pour distinguer les événements qu'il déclenche lui-même de ceux "
1383 "qui ont été déclenchés par d'autres processus."
1384
1385 #. type: Plain text
1386 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1387 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1388 msgid ""
1389 "Inotify reports only events that a user-space program triggers through the "
1390 "filesystem API. As a result, it does not catch remote events that occur on "
1391 "network filesystems. (Applications must fall back to polling the filesystem "
1392 "to catch such events.) Furthermore, various pseudo-filesystems such as I</"
1393 "proc>, I</sys>, and I</dev/pts> are not monitorable with inotify."
1394 msgstr ""
1395 "Inotify ne signale que les événements déclenchés par un programme en espace "
1396 "utilisateur à l’aide de l’interface de programmation de système de fichiers. "
1397 "Par conséquent, elle n’intercepte pas les événements qui surviennent sur les "
1398 "systèmes de fichiers en réseau (les applications doivent avoir recours à la "
1399 "scrutation (polling) pour intercepter ce type d’événements). De plus, divers "
1400 "pseudo-systèmes de fichiers comme I</proc>, I</sys> et I</dev/pts> ne sont "
1401 "pas surveillables avec inotify."
1402
1403 #. type: Plain text
1404 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1405 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1406 msgid ""
1407 "The inotify API does not report file accesses and modifications that may "
1408 "occur because of B<mmap>(2), B<msync>(2), and B<munmap>(2)."
1409 msgstr ""
1410 "L'interface inotify ne signale pas les accès ni les modifications de fichier "
1411 "qui pourraient survenir à cause de B<mmap>(2), B<msync>(2) ou B<munmap>(2)."
1412
1413 #. type: Plain text
1414 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1415 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1416 msgid ""
1417 "The inotify API identifies affected files by filename. However, by the time "
1418 "an application processes an inotify event, the filename may already have "
1419 "been deleted or renamed."
1420 msgstr ""
1421 "L'interface inotify identifie les fichiers affectés par leur nom. Cependant, "
1422 "au moment où l'application traite un événement inotify, ce nom de fichier "
1423 "peut avoir déjà été supprimé ou renommé."
1424
1425 #. type: Plain text
1426 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1427 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1428 msgid ""
1429 "The inotify API identifies events via watch descriptors. It is the "
1430 "application's responsibility to cache a mapping (if one is needed) between "
1431 "watch descriptors and pathnames. Be aware that directory renamings may "
1432 "affect multiple cached pathnames."
1433 msgstr ""
1434 "L’interface inotify identifie les événements à l’aide de descripteurs de "
1435 "surveillance. L’application est responsable de mettre en cache une "
1436 "correspondance (si nécessaire) entre les descripteurs de fichier et les "
1437 "chemins. Soyez vigilants aux renommages de répertoire qui pourraient "
1438 "affecter plusieurs chemins en cache."
1439
1440 #. type: Plain text
1441 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1442 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1443 msgid ""
1444 "Inotify monitoring of directories is not recursive: to monitor "
1445 "subdirectories under a directory, additional watches must be created. This "
1446 "can take a significant amount time for large directory trees."
1447 msgstr ""
1448 "La surveillance inotify des répertoires n'est pas récursive\\ : pour "
1449 "surveiller les sous-répertoires, des éléments de surveillance "
1450 "supplémentaires doivent être créés. Cela peut être assez long pour les "
1451 "répertoires contenant une grande arborescence."
1452
1453 #. type: Plain text
1454 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1455 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1456 msgid ""
1457 "If monitoring an entire directory subtree, and a new subdirectory is created "
1458 "in that tree or an existing directory is renamed into that tree, be aware "
1459 "that by the time you create a watch for the new subdirectory, new files (and "
1460 "subdirectories) may already exist inside the subdirectory. Therefore, you "
1461 "may want to scan the contents of the subdirectory immediately after adding "
1462 "the watch (and, if desired, recursively add watches for any subdirectories "
1463 "that it contains)."
1464 msgstr ""
1465 "Si la surveillance concerne une arborescence dans son intégralité, et si un "
1466 "nouveau sous-répertoire est créé dans ce répertoire ou si un répertoire "
1467 "existant est renommé dans cette arborescence, soyez conscient qu'au moment "
1468 "où vous créez un élément de surveillance pour le nouveau sous-répertoire, de "
1469 "nouveaux fichiers (et sous-répertoires) peuvent déjà exister dans le sous-"
1470 "répertoire. Ainsi, vous devriez analyser le contenu du sous-répertoire "
1471 "immédiatement après avoir ajouté l'élément de surveillance (et, si "
1472 "nécessaire, ajouter des éléments de surveillance pour tous les sous-"
1473 "répertoires qu’il contient)."
1474
1475 #. type: Plain text
1476 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1477 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1478 msgid ""
1479 "Note that the event queue can overflow. In this case, events are lost. "
1480 "Robust applications should handle the possibility of lost events "
1481 "gracefully. For example, it may be necessary to rebuild part or all of the "
1482 "application cache. (One simple, but possibly expensive, approach is to "
1483 "close the inotify file descriptor, empty the cache, create a new inotify "
1484 "file descriptor, and then re-create watches and cache entries for the "
1485 "objects to be monitored.)"
1486 msgstr ""
1487 "Remarquez que la file d'événements peut déborder. Dans ce cas, des "
1488 "événements sont perdus. Les applications robustes devraient gérer "
1489 "correctement la possibilité de perdre des événements. Par exemple, la "
1490 "reconstruction de tout ou partie du cache de l’application pourrait être "
1491 "nécessaire (une approche simple, mais éventuellement coûteuse, est de fermer "
1492 "le descripteur de fichier inotify, vider le cache, créer un nouveau "
1493 "descripteur de fichier inotify et recréer les éléments de surveillance et "
1494 "les entrées du cache pour les objets à surveiller)."
1495
1496 #. type: Plain text
1497 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1498 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1499 msgid ""
1500 "If a filesystem is mounted on top of a monitored directory, no event is "
1501 "generated, and no events are generated for objects immediately under the new "
1502 "mount point. If the filesystem is subsequently unmounted, events will "
1503 "subsequently be generated for the directory and the objects it contains."
1504 msgstr ""
1505 "Si un système de fichiers est monté par dessus un répertoire surveillé, "
1506 "aucun événement n'est généré, pas plus que pour les objets se trouvant "
1507 "directement sous le nouveau point de montage. Si le système de fichiers est "
1508 "par la suite démonté, les événements seront créés pour le répertoire et les "
1509 "objets qu'il contient."
1510
1511 #. type: SS
1512 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1513 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1514 #, no-wrap
1515 msgid "Dealing with rename() events"
1516 msgstr "Traitement des événements rename()"
1517
1518 #. type: Plain text
1519 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1520 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1521 msgid ""
1522 "As noted above, the B<IN_MOVED_FROM> and B<IN_MOVED_TO> event pair that is "
1523 "generated by B<rename>(2) can be matched up via their shared cookie value. "
1524 "However, the task of matching has some challenges."
1525 msgstr ""
1526 "Comme noté précédemment, la paire d’événements B<IN_MOVED_FROM> et "
1527 "B<IN_MOVED_TO> générée par B<rename>(2) peut être assemblée à l’aide de la "
1528 "valeur de cookie partagé. Cependant, la tâche d’assemblage peut poser "
1529 "quelques problèmes."
1530
1531 #. type: Plain text
1532 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1533 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1534 msgid ""
1535 "These two events are usually consecutive in the event stream available when "
1536 "reading from the inotify file descriptor. However, this is not guaranteed. "
1537 "If multiple processes are triggering events for monitored objects, then (on "
1538 "rare occasions) an arbitrary number of other events may appear between the "
1539 "B<IN_MOVED_FROM> and B<IN_MOVED_TO> events. Furthermore, it is not "
1540 "guaranteed that the event pair is atomically inserted into the queue: there "
1541 "may be a brief interval where the B<IN_MOVED_FROM> has appeared, but the "
1542 "B<IN_MOVED_TO> has not."
1543 msgstr ""
1544 "Ces deux événements sont normalement consécutifs dans le flux d’événements "
1545 "disponibles lors de la lecture depuis le descripteur de fichiers inotify. "
1546 "Cependant, ce n’est pas garanti. Si plusieurs processus déclenchent des "
1547 "événements pour des objets surveillés, alors (rarement) un nombre arbitraire "
1548 "d’autres événements pourrait apparaître entre les événements "
1549 "B<IN_MOVED_FROM> et B<IN_MOVED_TO>. De plus, il n'est pas garanti que la "
1550 "paire d'événements soit insérée de façon atomique dans la file : il pourrait "
1551 "y avoir un bref intervalle au cours duquel B<IN_MOVED_FROM> est apparu, mais "
1552 "pas B<IN_MOVED_TO>."
1553
1554 #. type: Plain text
1555 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1556 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1557 msgid ""
1558 "Matching up the B<IN_MOVED_FROM> and B<IN_MOVED_TO> event pair generated by "
1559 "B<rename>(2) is thus inherently racy. (Don't forget that if an object is "
1560 "renamed outside of a monitored directory, there may not even be an "
1561 "B<IN_MOVED_TO> event.) Heuristic approaches (e.g., assume the events are "
1562 "always consecutive) can be used to ensure a match in most cases, but will "
1563 "inevitably miss some cases, causing the application to perceive the "
1564 "B<IN_MOVED_FROM> and B<IN_MOVED_TO> events as being unrelated. If watch "
1565 "descriptors are destroyed and re-created as a result, then those watch "
1566 "descriptors will be inconsistent with the watch descriptors in any pending "
1567 "events. (Re-creating the inotify file descriptor and rebuilding the cache "
1568 "may be useful to deal with this scenario.)"
1569 msgstr ""
1570 "L’assemblage de la paire d’événements B<IN_MOVED_FROM> et B<IN_MOVED_TO> "
1571 "générés par B<rename>(2) pose donc intrinsèquement un risque de situation de "
1572 "compétition (n’oubliez pas que si un objet est renommé en dehors d’un "
1573 "répertoire surveillé, un événement B<IN_MOVED_TO> pourrait ne même pas être "
1574 "envoyé). Des approches heuristiques (par exemple supposer que les événements "
1575 "sont toujours consécutifs) permettent d’assurer un assemblage dans la "
1576 "plupart des cas, mais manqueront forcément certains cas, forçant "
1577 "l’application à percevoir les événements B<IN_MOVED_FROM> et B<IN_MOVED_TO> "
1578 "comme indépendants. Si les descripteurs de surveillance sont détruits et "
1579 "recréés par conséquent, alors ces descripteurs de surveillance seront "
1580 "incohérents avec les descripteurs de surveillance dans tous les événements "
1581 "en attente (la recréation du descripteur de fichier inotify et la "
1582 "reconstruction du cache pourrait être utile dans ce cas)."
1583
1584 #. type: Plain text
1585 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1586 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1587 msgid ""
1588 "Applications should also allow for the possibility that the B<IN_MOVED_FROM> "
1589 "event was the last event that could fit in the buffer returned by the "
1590 "current call to B<read>(2), and the accompanying B<IN_MOVED_TO> event might "
1591 "be fetched only on the next B<read>(2), which should be done with a (small) "
1592 "timeout to allow for the fact that insertion of the "
1593 "B<IN_MOVED_FROM>+B<IN_MOVED_TO> event pair is not atomic, and also the "
1594 "possibility that there may not be any B<IN_MOVED_TO> event."
1595 msgstr ""
1596 "Les applications devraient aussi considérer la possibilité que l’événement "
1597 "B<IN_MOVED_FROM> soit le dernier événement ayant pu entrer dans le tampon "
1598 "renvoyé pour l’appel actuel de B<read>(2) et l’événement B<IN_MOVED_TO> "
1599 "accompagnant pourrait n’être récupéré que lors de l’appel B<read>(2) "
1600 "suivant, ce qui devrait être fait avec un (léger) délai pour permettre que "
1601 "l'insertion de la paire d'événements B<IN_MOVED_FROM>+B<IN_MOVED_TO> ne soit "
1602 "pas atomique et aussi qu'il n'y ait pas d'événement B<IN_MOVED_TO>."
1603
1604 #. type: SH
1605 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1606 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1607 #, no-wrap
1608 msgid "BUGS"
1609 msgstr "BOGUES"
1610
1611 #. commit 820c12d5d6c0890bc93dd63893924a13041fdc35
1612 #. type: Plain text
1613 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1614 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1615 msgid ""
1616 "Before Linux 3.19, B<fallocate>(2) did not create any inotify events. "
1617 "Since Linux 3.19, calls to B<fallocate>(2) generate B<IN_MODIFY> events."
1618 msgstr ""
1619 "Avant Linux 3.19, B<fallocate>(2) ne créait pas d'événements inotify. Depuis "
1620 "Linux 3.19, les appels à B<fallocate>(2) créent des événements B<IN_MODIFY>."
1621
1622 #. FIXME . kernel commit 611da04f7a31b2208e838be55a42c7a1310ae321
1623 #. implies that unmount events were buggy since Linux 2.6.11 to Linux 2.6.36
1624 #. type: Plain text
1625 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1626 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1627 msgid "Before Linux 2.6.16, the B<IN_ONESHOT> I<mask> flag does not work."
1628 msgstr ""
1629 "Avant Linux 2.6.16, l'attribut B<IN_ONESHOT> de I<mask> ne fonctionne pas."
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 "Tel que conçu et implémenté à l’origine, l’attribut B<IN_ONESHOT> ne forçait "
1641 "pas à générer un appel B<IN_IGNORED> lorsque la surveillance était supprimée "
1642 "après un événement. Cependant, en conséquence involontaire d’autres "
1643 "modifications, depuis Linux 2.6.36, un événement B<IN_IGNORED> est généré "
1644 "dans ce cas."
1645
1646 #. commit 1c17d18e3775485bf1e0ce79575eb637a94494a2
1647 #. type: Plain text
1648 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1649 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1650 msgid ""
1651 "Before Linux 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 msgstr ""
1657 "Avant Linux 2.6.25, le code du noyau qui était censé regrouper deux "
1658 "événements successifs (c'est-à-dire que les deux événements les plus récents "
1659 "pouvaient être fusionnés si le plus ancien des deux n'avait toujours pas été "
1660 "lu) vérifiait à la place si l'événement le plus récent pouvait être fusionné "
1661 "à l'événement non lu I<le plus ancien>."
1662
1663 #. FIXME . https://bugzilla.kernel.org/show_bug.cgi?id=77111
1664 #. type: Plain text
1665 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1666 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1667 msgid ""
1668 "When a watch descriptor is removed by calling B<inotify_rm_watch>(2) (or "
1669 "because a watch file is deleted or the filesystem that contains it is "
1670 "unmounted), any pending unread events for that watch descriptor remain "
1671 "available to read. As watch descriptors are subsequently allocated with "
1672 "B<inotify_add_watch>(2), the kernel cycles through the range of possible "
1673 "watch descriptors (1 to B<INT_MAX>) incrementally. When allocating a free "
1674 "watch descriptor, no check is made to see whether that watch descriptor "
1675 "number has any pending unread events in the inotify queue. Thus, it can "
1676 "happen that a watch descriptor is reallocated even when pending unread "
1677 "events exist for a previous incarnation of that watch descriptor number, "
1678 "with the result that the application might then read those events and "
1679 "interpret them as belonging to the file associated with the newly recycled "
1680 "watch descriptor. In practice, the likelihood of hitting this bug may be "
1681 "extremely low, since it requires that an application cycle through "
1682 "B<INT_MAX> watch descriptors, release a watch descriptor while leaving "
1683 "unread events for that watch descriptor in the queue, and then recycle that "
1684 "watch descriptor. For this reason, and because there have been no reports "
1685 "of the bug occurring in real-world applications, as of Linux 3.15, no kernel "
1686 "changes have yet been made to eliminate this possible bug."
1687 msgstr ""
1688 "Quand un descripteur de surveillance est supprimé en appelant "
1689 "B<inotify_rm_watch>(2) (ou parce qu’un fichier de surveillance est supprimé "
1690 "ou que le système de fichiers qui le contient est démonté), tous les "
1691 "événements non lus en attente pour ce descripteur de fichier restent "
1692 "disponibles en lecture. Comme les descripteurs de surveillance sont ensuite "
1693 "alloués avec B<inotify_add_watch>(2), le noyau boucle sur l’intervalle des "
1694 "descripteurs de surveillance possibles (1 à B<INT_MAX>) de façon "
1695 "incrémentielle. Lors de l’allocation d’un descripteur de surveillance libre, "
1696 "aucune vérification n’est effectuée pour voir si ce numéro de descripteur de "
1697 "surveillance a des événements non lus en attente dans la file inotify. "
1698 "Ainsi, un descripteur de surveillance pourrait être réalloué même quand des "
1699 "événements non lus en attente existent pour une incarnation précédente de ce "
1700 "numéro de descripteur de surveillance, avec comme résultat que l’application "
1701 "pourrait alors lire ces événements et les interpréter comme appartenant au "
1702 "fichier associé au descripteur de surveillance nouvellement recyclé. En "
1703 "pratique, la probabilité d’être victime de ce bogue devrait être extrêmement "
1704 "basse, puisqu’il nécessite qu’une application boucle sur "
1705 "B<INT_MAX> descripteurs de surveillance, relâche un descripteur de "
1706 "surveillance tout en laissant des événements non lus pour ce descripteur de "
1707 "fichier dans la file et ensuite recycle ce descripteur de surveillance. Pour "
1708 "cette raison, et parce qu’il n’y a eu aucun rapports de bogue à propos de "
1709 "réelles applications, dans Linux 3.15, aucune modification de noyau n’a "
1710 "encore été faite pour éliminer ce bogue éventuel."
1711
1712 #. type: SH
1713 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1714 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1715 #, no-wrap
1716 msgid "EXAMPLES"
1717 msgstr "EXEMPLES"
1718
1719 #. type: Plain text
1720 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1721 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1722 msgid ""
1723 "The following program demonstrates the usage of the inotify API. It marks "
1724 "the directories passed as a command-line arguments and waits for events of "
1725 "type B<IN_OPEN>, B<IN_CLOSE_NOWRITE>, and B<IN_CLOSE_WRITE>."
1726 msgstr ""
1727 "Le programme suivant montre l’utilisation de l’interface de programmation "
1728 "inotify. Il marque les répertoires passés en arguments de ligne de commande "
1729 "et attend les événements de type B<IN_OPEN>, B<IN_CLOSE_NOWRITE> et "
1730 "B<IN_CLOSE_WRITE>."
1731
1732 #. type: Plain text
1733 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1734 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1735 msgid ""
1736 "The following output was recorded while editing the file I</home/user/temp/"
1737 "foo> and listing directory I</tmp>. Before the file and the directory were "
1738 "opened, B<IN_OPEN> events occurred. After the file was closed, an "
1739 "B<IN_CLOSE_WRITE> event occurred. After the directory was closed, an "
1740 "B<IN_CLOSE_NOWRITE> event occurred. Execution of the program ended when the "
1741 "user pressed the ENTER key."
1742 msgstr ""
1743 "La sortie suivante a été enregistrée lors de la modification du fichier I</"
1744 "home/utilisateur/temp/toto> et de l’affichage du contenu du répertoire I</"
1745 "tmp>. Avant d’ouvrir le fichier et le répertoire, un événement B<IN_OPEN> "
1746 "est survenu. Après la fermeture du fichier, un événement B<IN_CLOSE_WRITE> "
1747 "est survenu. Après la fermeture du répertoire, un événement "
1748 "B<IN_CLOSE_NOWRITE> est survenu. L’exécution du programme s’est terminée "
1749 "quand l’utilisateur a appuyé sur la touche Entrée."
1750
1751 #. type: SS
1752 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1753 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1754 #, no-wrap
1755 msgid "Example output"
1756 msgstr "Sortie de l’exemple"
1757
1758 #. type: Plain text
1759 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
1760 #: opensuse-tumbleweed
1761 #, fuzzy, no-wrap
1762 #| msgid ""
1763 #| "$ B<./a.out /tmp /home/user/temp>\n"
1764 #| "Press enter key to terminate.\n"
1765 #| "Listening for events.\n"
1766 #| "IN_OPEN: /home/user/temp/foo [file]\n"
1767 #| "IN_CLOSE_WRITE: /home/user/temp/foo [file]\n"
1768 #| "IN_OPEN: /tmp/ [directory]\n"
1769 #| "IN_CLOSE_NOWRITE: /tmp/ [directory]\n"
1770 #| "\\&\n"
1771 #| "Listening for events stopped.\n"
1772 msgid ""
1773 "$B< ./a.out /tmp /home/user/temp>;\n"
1774 "Press enter key to terminate.\n"
1775 "Listening for events.\n"
1776 "IN_OPEN: /home/user/temp/foo [file]\n"
1777 "IN_CLOSE_WRITE: /home/user/temp/foo [file]\n"
1778 "IN_OPEN: /tmp/ [directory]\n"
1779 "IN_CLOSE_NOWRITE: /tmp/ [directory]\n"
1780 "\\&\n"
1781 "Listening for events stopped.\n"
1782 msgstr ""
1783 "$ B<./a.out /tmp /home/utilisateur/temp>\n"
1784 "Appuyer sur la touche Entrée pour quitter.\n"
1785 "En écoute d’événements.\n"
1786 "IN_OPEN : /home/utilisateur/temp/toto [fichier]\n"
1787 "IN_CLOSE_WRITE : /home/utilisateur/temp/toto [fichier]\n"
1788 "IN_OPEN : /tmp/ [répertoire]\n"
1789 "IN_CLOSE_NOWRITE : /tmp/ [répertoire]\n"
1790 "\\&\n"
1791 "Arrêt de l’écoute d’événements.\n"
1792
1793 #. type: SS
1794 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1795 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1796 #, no-wrap
1797 msgid "Program source"
1798 msgstr "Source du programme"
1799
1800 #. type: Plain text
1801 #: archlinux debian-unstable opensuse-leap-16-1 opensuse-tumbleweed
1802 #, fuzzy, no-wrap
1803 #| msgid ""
1804 #| "#include E<lt>errno.hE<gt>\n"
1805 #| "#include E<lt>poll.hE<gt>\n"
1806 #| "#include E<lt>stdio.hE<gt>\n"
1807 #| "#include E<lt>stdlib.hE<gt>\n"
1808 #| "#include E<lt>sys/inotify.hE<gt>\n"
1809 #| "#include E<lt>unistd.hE<gt>\n"
1810 #| "#include E<lt>string.hE<gt>\n"
1811 #| "\\&\n"
1812 #| "/* Read all available inotify events from the file descriptor \\[aq]fd\\[aq].\n"
1813 #| " wd is the table of watch descriptors for the directories in argv.\n"
1814 #| " argc is the size of wd and argv.\n"
1815 #| " argv is the list of watched directories.\n"
1816 #| " Entry 0 of wd and argv is unused. */\n"
1817 #| "\\&\n"
1818 #| "static void\n"
1819 #| "handle_events(int fd, int *wd, int argc, char* argv[])\n"
1820 #| "{\n"
1821 #| " /* Some systems cannot read integer variables if they are not\n"
1822 #| " properly aligned. On other systems, incorrect alignment may\n"
1823 #| " decrease performance. Hence, the buffer used for reading from\n"
1824 #| " the inotify file descriptor should have the same alignment as\n"
1825 #| " struct inotify_event. */\n"
1826 #| "\\&\n"
1827 #| " char buf[4096]\n"
1828 #| " __attribute__ ((aligned(__alignof__(struct inotify_event))));\n"
1829 #| " const struct inotify_event *event;\n"
1830 #| " ssize_t size;\n"
1831 #| "\\&\n"
1832 #| " /* Loop while events can be read from inotify file descriptor. */\n"
1833 #| "\\&\n"
1834 #| " for (;;) {\n"
1835 #| "\\&\n"
1836 #| " /* Read some events. */\n"
1837 #| "\\&\n"
1838 #| " size = read(fd, buf, sizeof(buf));\n"
1839 #| " if (size == -1 && errno != EAGAIN) {\n"
1840 #| " perror(\"read\");\n"
1841 #| " exit(EXIT_FAILURE);\n"
1842 #| " }\n"
1843 #| "\\&\n"
1844 #| " /* If the nonblocking read() found no events to read, then\n"
1845 #| " it returns -1 with errno set to EAGAIN. In that case,\n"
1846 #| " we exit the loop. */\n"
1847 #| "\\&\n"
1848 #| " if (size E<lt>= 0)\n"
1849 #| " break;\n"
1850 #| "\\&\n"
1851 #| " /* Loop over all events in the buffer. */\n"
1852 #| "\\&\n"
1853 #| " for (char *ptr = buf; ptr E<lt> buf + size;\n"
1854 #| " ptr += sizeof(struct inotify_event) + event-E<gt>len) {\n"
1855 #| "\\&\n"
1856 #| " event = (const struct inotify_event *) ptr;\n"
1857 #| "\\&\n"
1858 #| " /* Print event type. */\n"
1859 #| "\\&\n"
1860 #| " if (event-E<gt>mask & IN_OPEN)\n"
1861 #| " printf(\"IN_OPEN: \");\n"
1862 #| " if (event-E<gt>mask & IN_CLOSE_NOWRITE)\n"
1863 #| " printf(\"IN_CLOSE_NOWRITE: \");\n"
1864 #| " if (event-E<gt>mask & IN_CLOSE_WRITE)\n"
1865 #| " printf(\"IN_CLOSE_WRITE: \");\n"
1866 #| "\\&\n"
1867 #| " /* Print the name of the watched directory. */\n"
1868 #| "\\&\n"
1869 #| " for (size_t i = 1; i E<lt> argc; ++i) {\n"
1870 #| " if (wd[i] == event-E<gt>wd) {\n"
1871 #| " printf(\"%s/\", argv[i]);\n"
1872 #| " break;\n"
1873 #| " }\n"
1874 #| " }\n"
1875 #| "\\&\n"
1876 #| " /* Print the name of the file. */\n"
1877 #| "\\&\n"
1878 #| " if (event-E<gt>len)\n"
1879 #| " printf(\"%s\", event-E<gt>name);\n"
1880 #| "\\&\n"
1881 #| " /* Print type of filesystem object. */\n"
1882 #| "\\&\n"
1883 #| " if (event-E<gt>mask & IN_ISDIR)\n"
1884 #| " printf(\" [directory]\\[rs]n\");\n"
1885 #| " else\n"
1886 #| " printf(\" [file]\\[rs]n\");\n"
1887 #| " }\n"
1888 #| " }\n"
1889 #| "}\n"
1890 #| "\\&\n"
1891 #| "int\n"
1892 #| "main(int argc, char* argv[])\n"
1893 #| "{\n"
1894 #| " char buf;\n"
1895 #| " int fd, i, poll_num;\n"
1896 #| " int *wd;\n"
1897 #| " nfds_t nfds;\n"
1898 #| " struct pollfd fds[2];\n"
1899 #| "\\&\n"
1900 #| " if (argc E<lt> 2) {\n"
1901 #| " printf(\"Usage: %s PATH [PATH ...]\\[rs]n\", argv[0]);\n"
1902 #| " exit(EXIT_FAILURE);\n"
1903 #| " }\n"
1904 #| "\\&\n"
1905 #| " printf(\"Press ENTER key to terminate.\\[rs]n\");\n"
1906 #| "\\&\n"
1907 #| " /* Create the file descriptor for accessing the inotify API. */\n"
1908 #| "\\&\n"
1909 #| " fd = inotify_init1(IN_NONBLOCK);\n"
1910 #| " if (fd == -1) {\n"
1911 #| " perror(\"inotify_init1\");\n"
1912 #| " exit(EXIT_FAILURE);\n"
1913 #| " }\n"
1914 #| "\\&\n"
1915 #| " /* Allocate memory for watch descriptors. */\n"
1916 #| "\\&\n"
1917 #| " wd = calloc(argc, sizeof(int));\n"
1918 #| " if (wd == NULL) {\n"
1919 #| " perror(\"calloc\");\n"
1920 #| " exit(EXIT_FAILURE);\n"
1921 #| " }\n"
1922 #| "\\&\n"
1923 #| " /* Mark directories for events\n"
1924 #| " - file was opened\n"
1925 #| " - file was closed */\n"
1926 #| "\\&\n"
1927 #| " for (i = 1; i E<lt> argc; i++) {\n"
1928 #| " wd[i] = inotify_add_watch(fd, argv[i],\n"
1929 #| " IN_OPEN | IN_CLOSE);\n"
1930 #| " if (wd[i] == -1) {\n"
1931 #| " fprintf(stderr, \"Cannot watch \\[aq]%s\\[aq]: %s\\[rs]n\",\n"
1932 #| " argv[i], strerror(errno));\n"
1933 #| " exit(EXIT_FAILURE);\n"
1934 #| " }\n"
1935 #| " }\n"
1936 #| "\\&\n"
1937 #| " /* Prepare for polling. */\n"
1938 #| "\\&\n"
1939 #| " nfds = 2;\n"
1940 #| "\\&\n"
1941 #| " fds[0].fd = STDIN_FILENO; /* Console input */\n"
1942 #| " fds[0].events = POLLIN;\n"
1943 #| "\\&\n"
1944 #| " fds[1].fd = fd; /* Inotify input */\n"
1945 #| " fds[1].events = POLLIN;\n"
1946 #| "\\&\n"
1947 #| " /* Wait for events and/or terminal input. */\n"
1948 #| "\\&\n"
1949 #| " printf(\"Listening for events.\\[rs]n\");\n"
1950 #| " while (1) {\n"
1951 #| " poll_num = poll(fds, nfds, -1);\n"
1952 #| " if (poll_num == -1) {\n"
1953 #| " if (errno == EINTR)\n"
1954 #| " continue;\n"
1955 #| " perror(\"poll\");\n"
1956 #| " exit(EXIT_FAILURE);\n"
1957 #| " }\n"
1958 #| "\\&\n"
1959 #| " if (poll_num E<gt> 0) {\n"
1960 #| "\\&\n"
1961 #| " if (fds[0].revents & POLLIN) {\n"
1962 #| "\\&\n"
1963 #| " /* Console input is available. Empty stdin and quit. */\n"
1964 #| "\\&\n"
1965 #| " while (read(STDIN_FILENO, &buf, 1) E<gt> 0 && buf != \\[aq]\\[rs]n\\[aq])\n"
1966 #| " continue;\n"
1967 #| " break;\n"
1968 #| " }\n"
1969 #| "\\&\n"
1970 #| " if (fds[1].revents & POLLIN) {\n"
1971 #| "\\&\n"
1972 #| " /* Inotify events are available. */\n"
1973 #| "\\&\n"
1974 #| " handle_events(fd, wd, argc, argv);\n"
1975 #| " }\n"
1976 #| " }\n"
1977 #| " }\n"
1978 #| "\\&\n"
1979 #| " printf(\"Listening for events stopped.\\[rs]n\");\n"
1980 #| "\\&\n"
1981 #| " /* Close inotify file descriptor. */\n"
1982 #| "\\&\n"
1983 #| " close(fd);\n"
1984 #| "\\&\n"
1985 #| " free(wd);\n"
1986 #| " exit(EXIT_SUCCESS);\n"
1987 #| "}\n"
1988 msgid ""
1989 "#include E<lt>errno.hE<gt>\n"
1990 "#include E<lt>poll.hE<gt>\n"
1991 "#include E<lt>stdio.hE<gt>\n"
1992 "#include E<lt>stdlib.hE<gt>\n"
1993 "#include E<lt>sys/inotify.hE<gt>\n"
1994 "#include E<lt>unistd.hE<gt>\n"
1995 "#include E<lt>string.hE<gt>\n"
1996 "\\&\n"
1997 "/* Read all available inotify events from the file descriptor \\[aq]fd\\[aq].\n"
1998 " wd is the table of watch descriptors for the directories in argv.\n"
1999 " argc is the size of wd and argv.\n"
2000 " argv is the list of watched directories.\n"
2001 " Entry 0 of wd and argv is unused. */\n"
2002 "\\&\n"
2003 "static void\n"
2004 "handle_events(int fd, int *wd, int argc, char* argv[])\n"
2005 "{\n"
2006 " /* Some systems cannot read integer variables if they are not\n"
2007 " properly aligned. On other systems, incorrect alignment may\n"
2008 " decrease performance. Hence, the buffer used for reading from\n"
2009 " the inotify file descriptor should have the same alignment as\n"
2010 " struct inotify_event. */\n"
2011 "\\&\n"
2012 " char buf[4096]\n"
2013 " __attribute__ ((aligned(__alignof__(struct inotify_event))));\n"
2014 " const struct inotify_event *event;\n"
2015 " ssize_t size;\n"
2016 "\\&\n"
2017 " /* Loop while events can be read from inotify file descriptor. */\n"
2018 "\\&\n"
2019 " for (;;) {\n"
2020 "\\&\n"
2021 " /* Read some events. */\n"
2022 "\\&\n"
2023 " size = read(fd, buf, sizeof(buf));\n"
2024 " if (size == -1 && errno != EAGAIN) {\n"
2025 " perror(\"read\");\n"
2026 " exit(EXIT_FAILURE);\n"
2027 " }\n"
2028 "\\&\n"
2029 " /* If the nonblocking read() found no events to read, then\n"
2030 " it returns -1 with errno set to EAGAIN. In that case,\n"
2031 " we exit the loop. */\n"
2032 "\\&\n"
2033 " if (size E<lt>= 0)\n"
2034 " break;\n"
2035 "\\&\n"
2036 " /* Loop over all events in the buffer. */\n"
2037 "\\&\n"
2038 " for (char *ptr = buf; ptr E<lt> buf + size;\n"
2039 " ptr += sizeof(struct inotify_event) + event-E<gt>len) {\n"
2040 "\\&\n"
2041 " event = (const struct inotify_event *) ptr;\n"
2042 "\\&\n"
2043 " /* Print event type. */\n"
2044 "\\&\n"
2045 " if (event-E<gt>mask & IN_OPEN)\n"
2046 " printf(\"IN_OPEN: \");\n"
2047 " if (event-E<gt>mask & IN_CLOSE_NOWRITE)\n"
2048 " printf(\"IN_CLOSE_NOWRITE: \");\n"
2049 " if (event-E<gt>mask & IN_CLOSE_WRITE)\n"
2050 " printf(\"IN_CLOSE_WRITE: \");\n"
2051 "\\&\n"
2052 " /* Print the name of the watched directory. */\n"
2053 "\\&\n"
2054 " for (size_t i = 1; i E<lt> argc; ++i) {\n"
2055 " if (wd[i] == event-E<gt>wd) {\n"
2056 " printf(\"%s/\", argv[i]);\n"
2057 " break;\n"
2058 " }\n"
2059 " }\n"
2060 "\\&\n"
2061 " /* Print the name of the file. */\n"
2062 "\\&\n"
2063 " if (event-E<gt>len)\n"
2064 " printf(\"%s\", event-E<gt>name);\n"
2065 "\\&\n"
2066 " /* Print type of filesystem object. */\n"
2067 "\\&\n"
2068 " if (event-E<gt>mask & IN_ISDIR)\n"
2069 " printf(\" [directory]\\[rs]n\");\n"
2070 " else\n"
2071 " printf(\" [file]\\[rs]n\");\n"
2072 " }\n"
2073 " }\n"
2074 "}\n"
2075 "\\&\n"
2076 "int\n"
2077 "main(int argc, char* argv[])\n"
2078 "{\n"
2079 " char buf;\n"
2080 " int fd, i, poll_num;\n"
2081 " int *wd;\n"
2082 " nfds_t nfds;\n"
2083 " struct pollfd fds[2];\n"
2084 "\\&\n"
2085 " if (argc E<lt> 2) {\n"
2086 " printf(\"Usage: %s PATH [PATH ...]\\[rs]n\", argv[0]);\n"
2087 " exit(EXIT_FAILURE);\n"
2088 " }\n"
2089 "\\&\n"
2090 " printf(\"Press ENTER key to terminate.\\[rs]n\");\n"
2091 "\\&\n"
2092 " /* Create the file descriptor for accessing the inotify API. */\n"
2093 "\\&\n"
2094 " fd = inotify_init1(IN_NONBLOCK);\n"
2095 " if (fd == -1) {\n"
2096 " perror(\"inotify_init1\");\n"
2097 " exit(EXIT_FAILURE);\n"
2098 " }\n"
2099 "\\&\n"
2100 " /* Allocate memory for watch descriptors. */\n"
2101 "\\&\n"
2102 " wd = calloc(argc, sizeof(int));\n"
2103 " if (wd == NULL) {\n"
2104 " perror(\"calloc\");\n"
2105 " exit(EXIT_FAILURE);\n"
2106 " }\n"
2107 "\\&\n"
2108 " /* Mark directories for events\n"
2109 " - file was opened\n"
2110 " - file was closed */\n"
2111 "\\&\n"
2112 " for (i = 1; i E<lt> argc; i++) {\n"
2113 " wd[i] = inotify_add_watch(fd, argv[i],\n"
2114 " IN_OPEN | IN_CLOSE);\n"
2115 " if (wd[i] == -1) {\n"
2116 " fprintf(stderr, \"Cannot watch \\[aq]%s\\[aq]: %s\\[rs]n\",\n"
2117 " argv[i], strerror(errno));\n"
2118 " exit(EXIT_FAILURE);\n"
2119 " }\n"
2120 " }\n"
2121 "\\&\n"
2122 " /* Prepare for polling. */\n"
2123 "\\&\n"
2124 " nfds = 2;\n"
2125 "\\&\n"
2126 " fds[0].fd = STDIN_FILENO; /* Console input */\n"
2127 " fds[0].events = POLLIN;\n"
2128 "\\&\n"
2129 " fds[1].fd = fd; /* Inotify input */\n"
2130 " fds[1].events = POLLIN;\n"
2131 "\\&\n"
2132 " /* Wait for events and/or terminal input. */\n"
2133 "\\&\n"
2134 " printf(\"Listening for events.\\[rs]n\");\n"
2135 " for (;;) {\n"
2136 " poll_num = poll(fds, nfds, -1);\n"
2137 " if (poll_num == -1) {\n"
2138 " if (errno == EINTR)\n"
2139 " continue;\n"
2140 " perror(\"poll\");\n"
2141 " exit(EXIT_FAILURE);\n"
2142 " }\n"
2143 "\\&\n"
2144 " if (poll_num E<gt> 0) {\n"
2145 "\\&\n"
2146 " if (fds[0].revents & POLLIN) {\n"
2147 "\\&\n"
2148 " /* Console input is available. Empty stdin and quit. */\n"
2149 "\\&\n"
2150 " while (read(STDIN_FILENO, &buf, 1) E<gt> 0 && buf != \\[aq]\\[rs]n\\[aq])\n"
2151 " continue;\n"
2152 " break;\n"
2153 " }\n"
2154 "\\&\n"
2155 " if (fds[1].revents & POLLIN) {\n"
2156 "\\&\n"
2157 " /* Inotify events are available. */\n"
2158 "\\&\n"
2159 " handle_events(fd, wd, argc, argv);\n"
2160 " }\n"
2161 " }\n"
2162 " }\n"
2163 "\\&\n"
2164 " printf(\"Listening for events stopped.\\[rs]n\");\n"
2165 "\\&\n"
2166 " /* Close inotify file descriptor. */\n"
2167 "\\&\n"
2168 " close(fd);\n"
2169 "\\&\n"
2170 " free(wd);\n"
2171 " exit(EXIT_SUCCESS);\n"
2172 "}\n"
2173 msgstr ""
2174 "#include E<lt>errno.hE<gt>\n"
2175 "#include E<lt>poll.hE<gt>\n"
2176 "#include E<lt>stdio.hE<gt>\n"
2177 "#include E<lt>stdlib.hE<gt>\n"
2178 "#include E<lt>sys/inotify.hE<gt>\n"
2179 "#include E<lt>unistd.hE<gt>\n"
2180 "#include E<lt>string.hE<gt>\n"
2181 "\\&\n"
2182 "/* Lire tous les événements inotify disponibles à partir du\n"
2183 " descripteur de fichier «\\ fd\\ ».\n"
2184 " wd est le tableau des descripteurs de surveillance pour\n"
2185 " les répertoires en argv.\n"
2186 " argc est la taille de wd et argv.\n"
2187 " argv est la liste des répertoires surveillés.\n"
2188 " L’entrée\\ 0 de wd et argv n’est pas utilisée. */\n"
2189 "\\&\n"
2190 "static void\n"
2191 "handle_events(int fd, int *wd, int argc, char* argv[])\n"
2192 "{\n"
2193 " /* Certains systèmes ne peuvent pas lire de variables entières\n"
2194 " si elles ne sont pas alignées correctement. Sur d’autres\n"
2195 " systèmes, un alignement incorrect pourrait diminuer les\n"
2196 " performances. Par conséquent, le tampon utilisé pour lire\n"
2197 " le descripteur de fichier inotify devrait avoir le même\n"
2198 " alignement que struct inotify_event. */\n"
2199 "\\&\n"
2200 " char buf[4096]\n"
2201 " __attribute__ ((aligned(__alignof__(struct inotify_event))));\n"
2202 " const struct inotify_event *event;\n"
2203 " ssize_t size;\n"
2204 "\\&\n"
2205 " /* Boucler tant que les événements peuvent être lus à partir du\n"
2206 " descripteur de fichier inotify */\n"
2207 "\\&\n"
2208 " for (;;) {\n"
2209 "\\&\n"
2210 " /* Lire certains événements. */\n"
2211 "\\&\n"
2212 " size = read(fd, buf, sizeof(buf));\n"
2213 " if (size == -1 && errno != EAGAIN) {\n"
2214 " perror(\"read\");\n"
2215 " exit(EXIT_FAILURE);\n"
2216 " }\n"
2217 "\\&\n"
2218 " /* Si le read() non bloquant n’a pas trouvé d’événement à\n"
2219 " lire, il renvoie -1 avec errno défini à EAGAIN. Dans ce\n"
2220 " cas, on sort de la boucle. */\n"
2221 "\\&\n"
2222 " if (size E<lt>= 0)\n"
2223 " break;\n"
2224 "\\&\n"
2225 " /* Boucler sur tous les événements du tampon. */\n"
2226 "\\&\n"
2227 " for (char *ptr = buf; ptr E<lt> buf + size;\n"
2228 " ptr += sizeof(struct inotify_event) + event-E<gt>len) {\n"
2229 "\\&\n"
2230 " event = (const struct inotify_event *) ptr;\n"
2231 "\\&\n"
2232 " /* Afficher le type d’événement. */\n"
2233 "\\&\n"
2234 " if (event-E<gt>mask & IN_OPEN)\n"
2235 " printf(\"IN_OPEN: \");\n"
2236 " if (event-E<gt>mask & IN_CLOSE_NOWRITE)\n"
2237 " printf(\"IN_CLOSE_NOWRITE: \");\n"
2238 " if (event-E<gt>mask & IN_CLOSE_WRITE)\n"
2239 " printf(\"IN_CLOSE_WRITE: \");\n"
2240 "\\&\n"
2241 " /* Afficher le nom du répertoire surveillé. */\n"
2242 "\\&\n"
2243 " for (size_t i = 1; i E<lt> argc; ++i) {\n"
2244 " if (wd[i] == event-E<gt>wd) {\n"
2245 " printf(\"%s/\", argv[i]);\n"
2246 " break;\n"
2247 " }\n"
2248 " }\n"
2249 "\\&\n"
2250 " /* Afficher le nom du fichier. */\n"
2251 "\\&\n"
2252 " if (event-E<gt>len)\n"
2253 " printf(\"%s\", event-E<gt>name);\n"
2254 "\\&\n"
2255 " /* Afficher le type d’objet de système de fichiers. */\n"
2256 "\\&\n"
2257 " if (event-E<gt>mask & IN_ISDIR)\n"
2258 " printf(\" [répertoire]\\[rs]n\");\n"
2259 " else\n"
2260 " printf(\" [fichier]\\[rs]n\");\n"
2261 " }\n"
2262 " }\n"
2263 "}\n"
2264 "\\&\n"
2265 "int\n"
2266 "main(int argc, char* argv[])\n"
2267 "{\n"
2268 " char buf;\n"
2269 " int fd, i, poll_num;\n"
2270 " int *wd;\n"
2271 " nfds_t nfds;\n"
2272 " struct pollfd fds[2];\n"
2273 "\\&\n"
2274 " if (argc E<lt> 2) {\n"
2275 " printf(\"\"Utilisation\\ : %s CHEMIN [CHEMIN ...]\\[rs]n\", argv[0]);\n"
2276 " exit(EXIT_FAILURE);\n"
2277 " }\n"
2278 "\\&\n"
2279 " printf(\"Appuyer sur la touche Entrée pour quitter.\\[rs]n\");\n"
2280 "\\&\n"
2281 " /* Créer le descripteur de fichier pour accéder à l’interface de\n"
2282 " programmation inotify. */\n"
2283 "\\&\n"
2284 " fd = inotify_init1(IN_NONBLOCK);\n"
2285 " if (fd == -1) {\n"
2286 " perror(\"inotify_init1\");\n"
2287 " exit(EXIT_FAILURE);\n"
2288 " }\n"
2289 "\\&\n"
2290 " /* Allouer la mémoire pour les descripteurs de surveillance. */\n"
2291 "\\&\n"
2292 " wd = calloc(argc, sizeof(int));\n"
2293 " if (wd == NULL) {\n"
2294 " perror(\"calloc\");\n"
2295 " exit(EXIT_FAILURE);\n"
2296 " }\n"
2297 "\\&\n"
2298 " /* Marquer les répertoires pour les événements :\n"
2299 " - un fichier a été ouvert ;\n"
2300 " - un fichier a été fermé\n"
2301 "\\&\n"
2302 " for (i = 1; i E<lt> argc; i++) {\n"
2303 " wd[i] = inotify_add_watch(fd, argv[i],\n"
2304 " IN_OPEN | IN_CLOSE);\n"
2305 " if (wd[i] == -1) {\n"
2306 " fprintf(stderr, \"Impossible de surveiller « %s » : %s\\[rs]n\",\n"
2307 " argv[i], strerror(errno));\n"
2308 " exit(EXIT_FAILURE);\n"
2309 " }\n"
2310 " }\n"
2311 "\\&\n"
2312 " /* Préparer pour la scrutation (polling). */\n"
2313 "\\&\n"
2314 " nfds = 2;\n"
2315 "\\&\n"
2316 " fds[0].fd = STDIN_FILENO; /* Entrée de console */\n"
2317 " fds[0].events = POLLIN;\n"
2318 "\\&\n"
2319 " fds[1].fd = fd; /* Entrée d'inotify */\n"
2320 " fds[1].events = POLLIN;\n"
2321 "\\&\n"
2322 " /* Attendre les événements ou une entrée du terminal. */\n"
2323 "\\&\n"
2324 " printf(\"En écoute d’événements.\\[rs]n\");\n"
2325 " while (1) {\n"
2326 " poll_num = poll(fds, nfds, -1);\n"
2327 " if (poll_num == -1) {\n"
2328 " if (errno == EINTR)\n"
2329 " continue;\n"
2330 " perror(\"poll\");\n"
2331 " exit(EXIT_FAILURE);\n"
2332 " }\n"
2333 "\\&\n"
2334 " if (poll_num E<gt> 0) {\n"
2335 "\\&\n"
2336 " if (fds[0].revents & POLLIN) {\n"
2337 "\\&\n"
2338 " /* Entrée de console disponible.\n"
2339 " Vider l’entrée standard et quitter. */\n"
2340 "\\&\n"
2341 " while (read(STDIN_FILENO, &buf, 1) E<gt> 0 && buf != \\[aq]\\[rs]n\\[aq])\n"
2342 " continue;\n"
2343 " break;\n"
2344 " }\n"
2345 "\\&\n"
2346 " if (fds[1].revents & POLLIN) {\n"
2347 "\\&\n"
2348 " /* Des événements inotify sont disponibles. */\n"
2349 "\\&\n"
2350 " handle_events(fd, wd, argc, argv);\n"
2351 " }\n"
2352 " }\n"
2353 " }\n"
2354 "\\&\n"
2355 " printf(\"Arrêt de l’écoute d’événements.\\[rs]n\");\n"
2356 "\\&\n"
2357 " /* Fermer le descripteur de fichier inotify. */\n"
2358 "\\&\n"
2359 " close(fd);\n"
2360 "\\&\n"
2361 " free(wd);\n"
2362 " exit(EXIT_SUCCESS);\n"
2363 "}\n"
2364
2365 #. type: SH
2366 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2367 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2368 #, no-wrap
2369 msgid "SEE ALSO"
2370 msgstr "VOIR AUSSI"
2371
2372 #. type: Plain text
2373 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
2374 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
2375 msgid ""
2376 "B<inotifywait>(1), B<inotifywatch>(1), B<inotify_add_watch>(2), "
2377 "B<inotify_init>(2), B<inotify_init1>(2), B<inotify_rm_watch>(2), B<read>(2), "
2378 "B<stat>(2), B<fanotify>(7)"
2379 msgstr ""
2380 "B<inotifywait>(1), B<inotifywatch>(1), B<inotify_add_watch>(2), "
2381 "B<inotify_init>(2), B<inotify_init1>(2), B<inotify_rm_watch>(2), B<read>(2), "
2382 "B<stat>(2), B<fanotify>(7)"
2383
2384 #. type: Plain text
2385 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
2386 #: opensuse-tumbleweed
2387 #, fuzzy
2388 #| msgid ""
2389 #| "I<Documentation/filesystems/inotify.txt> in the Linux kernel source tree"
2390 msgid ""
2391 "I<Documentation/filesystems/inotify.rst> in the Linux kernel source tree"
2392 msgstr ""
2393 "I<Documentation/filesystems/inotify.txt> dans les sources du noyau Linux"
2394
2395 #. type: TH
2396 #: debian-trixie
2397 #, no-wrap
2398 msgid "2024-06-15"
2399 msgstr "15 juin 2024"
2400
2401 #. type: TH
2402 #: debian-trixie
2403 #, no-wrap
2404 msgid "Linux man-pages 6.9.1"
2405 msgstr "Pages du manuel de Linux 6.9.1"
2406
2407 #. FIXME . The type of the 'wd' field should probably be "int32_t".
2408 #. I submitted a patch to fix this. See the LKML thread
2409 #. "[patch] Fix type errors in inotify interfaces", 18 Nov 2008
2410 #. glibc bug filed: https://www.sourceware.org/bugzilla/show_bug.cgi?id=7040
2411 #. type: Plain text
2412 #: debian-trixie fedora-44 fedora-rawhide
2413 #, no-wrap
2414 msgid ""
2415 "struct inotify_event {\n"
2416 " int wd; /* Watch descriptor */\n"
2417 " uint32_t mask; /* Mask describing event */\n"
2418 " uint32_t cookie; /* Unique cookie associating related\n"
2419 " events (for rename(2)) */\n"
2420 " uint32_t len; /* Size of I<name> field */\n"
2421 " char name[]; /* Optional null-terminated name */\n"
2422 "};\n"
2423 msgstr ""
2424 "struct inotify_event {\n"
2425 " int wd; /* Descripteur de surveillance */\n"
2426 " uint32_t mask; /* Masque décrivant l’événement */\n"
2427 " uint32_t cookie; /* Cookie unique d'association des\n"
2428 " événements (pour rename(2)) */\n"
2429 " uint32_t len; /* Taille du champ I<name> */\n"
2430 " char name[]; /* Nom optionnel terminé par un nul */\n"
2431 "};\n"
2432
2433 #. type: Plain text
2434 #: debian-trixie
2435 msgid ""
2436 "The I<len> field counts all of the bytes in I<name>, including the null "
2437 "bytes; the length of each I<inotify_event> structure is thus I<sizeof(struct "
2438 "inotify_event)+len>."
2439 msgstr ""
2440 "Le champ I<len> compte tous les octets de I<name>, incluant les caractères "
2441 "nuls. La longueur de chaque structure I<inotify_event> vaut donc "
2442 "I<sizeof(structinotify_event)+len>."
2443
2444 #. type: Plain text
2445 #: debian-trixie fedora-44 fedora-rawhide
2446 #, no-wrap
2447 msgid ""
2448 "$ B<./a.out /tmp /home/user/temp>\n"
2449 "Press enter key to terminate.\n"
2450 "Listening for events.\n"
2451 "IN_OPEN: /home/user/temp/foo [file]\n"
2452 "IN_CLOSE_WRITE: /home/user/temp/foo [file]\n"
2453 "IN_OPEN: /tmp/ [directory]\n"
2454 "IN_CLOSE_NOWRITE: /tmp/ [directory]\n"
2455 "\\&\n"
2456 "Listening for events stopped.\n"
2457 msgstr ""
2458 "$ B<./a.out /tmp /home/utilisateur/temp>\n"
2459 "Appuyer sur la touche Entrée pour quitter.\n"
2460 "En écoute d’événements.\n"
2461 "IN_OPEN : /home/utilisateur/temp/toto [fichier]\n"
2462 "IN_CLOSE_WRITE : /home/utilisateur/temp/toto [fichier]\n"
2463 "IN_OPEN : /tmp/ [répertoire]\n"
2464 "IN_CLOSE_NOWRITE : /tmp/ [répertoire]\n"
2465 "\\&\n"
2466 "Arrêt de l’écoute d’événements.\n"
2467
2468 #. type: Plain text
2469 #: debian-trixie
2470 #, no-wrap
2471 msgid ""
2472 "#include E<lt>errno.hE<gt>\n"
2473 "#include E<lt>poll.hE<gt>\n"
2474 "#include E<lt>stdio.hE<gt>\n"
2475 "#include E<lt>stdlib.hE<gt>\n"
2476 "#include E<lt>sys/inotify.hE<gt>\n"
2477 "#include E<lt>unistd.hE<gt>\n"
2478 "#include E<lt>string.hE<gt>\n"
2479 "\\&\n"
2480 "/* Read all available inotify events from the file descriptor \\[aq]fd\\[aq].\n"
2481 " wd is the table of watch descriptors for the directories in argv.\n"
2482 " argc is the length of wd and argv.\n"
2483 " argv is the list of watched directories.\n"
2484 " Entry 0 of wd and argv is unused. */\n"
2485 "\\&\n"
2486 "static void\n"
2487 "handle_events(int fd, int *wd, int argc, char* argv[])\n"
2488 "{\n"
2489 " /* Some systems cannot read integer variables if they are not\n"
2490 " properly aligned. On other systems, incorrect alignment may\n"
2491 " decrease performance. Hence, the buffer used for reading from\n"
2492 " the inotify file descriptor should have the same alignment as\n"
2493 " struct inotify_event. */\n"
2494 "\\&\n"
2495 " char buf[4096]\n"
2496 " __attribute__ ((aligned(__alignof__(struct inotify_event))));\n"
2497 " const struct inotify_event *event;\n"
2498 " ssize_t len;\n"
2499 "\\&\n"
2500 " /* Loop while events can be read from inotify file descriptor. */\n"
2501 "\\&\n"
2502 " for (;;) {\n"
2503 "\\&\n"
2504 " /* Read some events. */\n"
2505 "\\&\n"
2506 " len = read(fd, buf, sizeof(buf));\n"
2507 " if (len == -1 && errno != EAGAIN) {\n"
2508 " perror(\"read\");\n"
2509 " exit(EXIT_FAILURE);\n"
2510 " }\n"
2511 "\\&\n"
2512 " /* If the nonblocking read() found no events to read, then\n"
2513 " it returns -1 with errno set to EAGAIN. In that case,\n"
2514 " we exit the loop. */\n"
2515 "\\&\n"
2516 " if (len E<lt>= 0)\n"
2517 " break;\n"
2518 "\\&\n"
2519 " /* Loop over all events in the buffer. */\n"
2520 "\\&\n"
2521 " for (char *ptr = buf; ptr E<lt> buf + len;\n"
2522 " ptr += sizeof(struct inotify_event) + event-E<gt>len) {\n"
2523 "\\&\n"
2524 " event = (const struct inotify_event *) ptr;\n"
2525 "\\&\n"
2526 " /* Print event type. */\n"
2527 "\\&\n"
2528 " if (event-E<gt>mask & IN_OPEN)\n"
2529 " printf(\"IN_OPEN: \");\n"
2530 " if (event-E<gt>mask & IN_CLOSE_NOWRITE)\n"
2531 " printf(\"IN_CLOSE_NOWRITE: \");\n"
2532 " if (event-E<gt>mask & IN_CLOSE_WRITE)\n"
2533 " printf(\"IN_CLOSE_WRITE: \");\n"
2534 "\\&\n"
2535 " /* Print the name of the watched directory. */\n"
2536 "\\&\n"
2537 " for (size_t i = 1; i E<lt> argc; ++i) {\n"
2538 " if (wd[i] == event-E<gt>wd) {\n"
2539 " printf(\"%s/\", argv[i]);\n"
2540 " break;\n"
2541 " }\n"
2542 " }\n"
2543 "\\&\n"
2544 " /* Print the name of the file. */\n"
2545 "\\&\n"
2546 " if (event-E<gt>len)\n"
2547 " printf(\"%s\", event-E<gt>name);\n"
2548 "\\&\n"
2549 " /* Print type of filesystem object. */\n"
2550 "\\&\n"
2551 " if (event-E<gt>mask & IN_ISDIR)\n"
2552 " printf(\" [directory]\\[rs]n\");\n"
2553 " else\n"
2554 " printf(\" [file]\\[rs]n\");\n"
2555 " }\n"
2556 " }\n"
2557 "}\n"
2558 "\\&\n"
2559 "int\n"
2560 "main(int argc, char* argv[])\n"
2561 "{\n"
2562 " char buf;\n"
2563 " int fd, i, poll_num;\n"
2564 " int *wd;\n"
2565 " nfds_t nfds;\n"
2566 " struct pollfd fds[2];\n"
2567 "\\&\n"
2568 " if (argc E<lt> 2) {\n"
2569 " printf(\"Usage: %s PATH [PATH ...]\\[rs]n\", argv[0]);\n"
2570 " exit(EXIT_FAILURE);\n"
2571 " }\n"
2572 "\\&\n"
2573 " printf(\"Press ENTER key to terminate.\\[rs]n\");\n"
2574 "\\&\n"
2575 " /* Create the file descriptor for accessing the inotify API. */\n"
2576 "\\&\n"
2577 " fd = inotify_init1(IN_NONBLOCK);\n"
2578 " if (fd == -1) {\n"
2579 " perror(\"inotify_init1\");\n"
2580 " exit(EXIT_FAILURE);\n"
2581 " }\n"
2582 "\\&\n"
2583 " /* Allocate memory for watch descriptors. */\n"
2584 "\\&\n"
2585 " wd = calloc(argc, sizeof(int));\n"
2586 " if (wd == NULL) {\n"
2587 " perror(\"calloc\");\n"
2588 " exit(EXIT_FAILURE);\n"
2589 " }\n"
2590 "\\&\n"
2591 " /* Mark directories for events\n"
2592 " - file was opened\n"
2593 " - file was closed */\n"
2594 "\\&\n"
2595 " for (i = 1; i E<lt> argc; i++) {\n"
2596 " wd[i] = inotify_add_watch(fd, argv[i],\n"
2597 " IN_OPEN | IN_CLOSE);\n"
2598 " if (wd[i] == -1) {\n"
2599 " fprintf(stderr, \"Cannot watch \\[aq]%s\\[aq]: %s\\[rs]n\",\n"
2600 " argv[i], strerror(errno));\n"
2601 " exit(EXIT_FAILURE);\n"
2602 " }\n"
2603 " }\n"
2604 "\\&\n"
2605 " /* Prepare for polling. */\n"
2606 "\\&\n"
2607 " nfds = 2;\n"
2608 "\\&\n"
2609 " fds[0].fd = STDIN_FILENO; /* Console input */\n"
2610 " fds[0].events = POLLIN;\n"
2611 "\\&\n"
2612 " fds[1].fd = fd; /* Inotify input */\n"
2613 " fds[1].events = POLLIN;\n"
2614 "\\&\n"
2615 " /* Wait for events and/or terminal input. */\n"
2616 "\\&\n"
2617 " printf(\"Listening for events.\\[rs]n\");\n"
2618 " while (1) {\n"
2619 " poll_num = poll(fds, nfds, -1);\n"
2620 " if (poll_num == -1) {\n"
2621 " if (errno == EINTR)\n"
2622 " continue;\n"
2623 " perror(\"poll\");\n"
2624 " exit(EXIT_FAILURE);\n"
2625 " }\n"
2626 "\\&\n"
2627 " if (poll_num E<gt> 0) {\n"
2628 "\\&\n"
2629 " if (fds[0].revents & POLLIN) {\n"
2630 "\\&\n"
2631 " /* Console input is available. Empty stdin and quit. */\n"
2632 "\\&\n"
2633 " while (read(STDIN_FILENO, &buf, 1) E<gt> 0 && buf != \\[aq]\\[rs]n\\[aq])\n"
2634 " continue;\n"
2635 " break;\n"
2636 " }\n"
2637 "\\&\n"
2638 " if (fds[1].revents & POLLIN) {\n"
2639 "\\&\n"
2640 " /* Inotify events are available. */\n"
2641 "\\&\n"
2642 " handle_events(fd, wd, argc, argv);\n"
2643 " }\n"
2644 " }\n"
2645 " }\n"
2646 "\\&\n"
2647 " printf(\"Listening for events stopped.\\[rs]n\");\n"
2648 "\\&\n"
2649 " /* Close inotify file descriptor. */\n"
2650 "\\&\n"
2651 " close(fd);\n"
2652 "\\&\n"
2653 " free(wd);\n"
2654 " exit(EXIT_SUCCESS);\n"
2655 "}\n"
2656 msgstr ""
2657 "#include E<lt>errno.hE<gt>\n"
2658 "#include E<lt>poll.hE<gt>\n"
2659 "#include E<lt>stdio.hE<gt>\n"
2660 "#include E<lt>stdlib.hE<gt>\n"
2661 "#include E<lt>sys/inotify.hE<gt>\n"
2662 "#include E<lt>unistd.hE<gt>\n"
2663 "#include E<lt>string.hE<gt>\n"
2664 "\\&\n"
2665 "/* Lire tous les événements inotify disponibles à partir du\n"
2666 " descripteur de fichier «\\ fd\\ ».\n"
2667 " wd est le tableau des descripteurs de surveillance pour\n"
2668 " les répertoires en argv.\n"
2669 " argc est la taille de wd et argv.\n"
2670 " argv est la liste des répertoires surveillés.\n"
2671 " L’entrée\\ 0 de wd et argv n’est pas utilisée. */\n"
2672 "\\&\n"
2673 "static void\n"
2674 "handle_events(int fd, int *wd, int argc, char* argv[])\n"
2675 "{\n"
2676 " /* Certains systèmes ne peuvent pas lire de variables entières\n"
2677 " si elles ne sont pas alignées correctement. Sur d’autres\n"
2678 " systèmes, un alignement incorrect pourrait diminuer les\n"
2679 " performances. Par conséquent, le tampon utilisé pour lire\n"
2680 " le descripteur de fichier inotify devrait avoir le même\n"
2681 " alignement que struct inotify_event. */\n"
2682 "\\&\n"
2683 " char buf[4096]\n"
2684 " __attribute__ ((aligned(__alignof__(struct inotify_event))));\n"
2685 " const struct inotify_event *event;\n"
2686 " ssize_t len;\n"
2687 "\\&\n"
2688 " /* Boucler tant que les événements peuvent être lus à partir du\n"
2689 " descripteur de fichier inotify */\n"
2690 "\\&\n"
2691 " for (;;) {\n"
2692 "\\&\n"
2693 " /* Lire certains événements. */\n"
2694 "\\&\n"
2695 " len = read(fd, buf, sizeof(buf));\n"
2696 " if (len == -1 && errno != EAGAIN) {\n"
2697 " perror(\"read\");\n"
2698 " exit(EXIT_FAILURE);\n"
2699 " }\n"
2700 "\\&\n"
2701 " /* Si le read() non bloquant n’a pas trouvé d’événement à\n"
2702 " lire, il renvoie -1 avec errno défini à EAGAIN. Dans ce\n"
2703 " cas, on sort de la boucle. */\n"
2704 "\\&\n"
2705 " if (len E<lt>= 0)\n"
2706 " break;\n"
2707 "\\&\n"
2708 " /* Boucler sur tous les événements du tampon. */\n"
2709 "\\&\n"
2710 " for (char *ptr = buf; ptr E<lt> buf + len;\n"
2711 " ptr += sizeof(struct inotify_event) + event-E<gt>len) {\n"
2712 "\\&\n"
2713 " event = (const struct inotify_event *) ptr;\n"
2714 "\\&\n"
2715 " /* Afficher le type d’événement. */\n"
2716 "\\&\n"
2717 " if (event-E<gt>mask & IN_OPEN)\n"
2718 " printf(\"IN_OPEN: \");\n"
2719 " if (event-E<gt>mask & IN_CLOSE_NOWRITE)\n"
2720 " printf(\"IN_CLOSE_NOWRITE: \");\n"
2721 " if (event-E<gt>mask & IN_CLOSE_WRITE)\n"
2722 " printf(\"IN_CLOSE_WRITE: \");\n"
2723 "\\&\n"
2724 " /* Afficher le nom du répertoire surveillé. */\n"
2725 "\\&\n"
2726 " for (size_t i = 1; i E<lt> argc; ++i) {\n"
2727 " if (wd[i] == event-E<gt>wd) {\n"
2728 " printf(\"%s/\", argv[i]);\n"
2729 " break;\n"
2730 " }\n"
2731 " }\n"
2732 "\\&\n"
2733 " /* Afficher le nom du fichier. */\n"
2734 "\\&\n"
2735 " if (event-E<gt>len)\n"
2736 " printf(\"%s\", event-E<gt>name);\n"
2737 "\\&\n"
2738 " /* Afficher le type d’objet de système de fichiers. */\n"
2739 "\\&\n"
2740 " if (event-E<gt>mask & IN_ISDIR)\n"
2741 " printf(\" [répertoire]\\[rs]n\");\n"
2742 " else\n"
2743 " printf(\" [fichier]\\[rs]n\");\n"
2744 " }\n"
2745 " }\n"
2746 "}\n"
2747 "\\&\n"
2748 "int\n"
2749 "main(int argc, char* argv[])\n"
2750 "{\n"
2751 " char buf;\n"
2752 " int fd, i, poll_num;\n"
2753 " int *wd;\n"
2754 " nfds_t nfds;\n"
2755 " struct pollfd fds[2];\n"
2756 "\\&\n"
2757 " if (argc E<lt> 2) {\n"
2758 " printf(\"\"Utilisation\\ : %s CHEMIN [CHEMIN ...]\\[rs]n\", argv[0]);\n"
2759 " exit(EXIT_FAILURE);\n"
2760 " }\n"
2761 "\\&\n"
2762 " printf(\"Appuyer sur la touche Entrée pour quitter.\\[rs]n\");\n"
2763 "\\&\n"
2764 " /* Créer le descripteur de fichier pour accéder à l’interface de\n"
2765 " programmation inotify. */\n"
2766 "\\&\n"
2767 " fd = inotify_init1(IN_NONBLOCK);\n"
2768 " if (fd == -1) {\n"
2769 " perror(\"inotify_init1\");\n"
2770 " exit(EXIT_FAILURE);\n"
2771 " }\n"
2772 "\\&\n"
2773 " /* Allouer la mémoire pour les descripteurs de surveillance. */\n"
2774 "\\&\n"
2775 " wd = calloc(argc, sizeof(int));\n"
2776 " if (wd == NULL) {\n"
2777 " perror(\"calloc\");\n"
2778 " exit(EXIT_FAILURE);\n"
2779 " }\n"
2780 "\\&\n"
2781 " /* Marquer les répertoires pour les événements :\n"
2782 " - un fichier a été ouvert ;\n"
2783 " - un fichier a été fermé\n"
2784 "\\&\n"
2785 " for (i = 1; i E<lt> argc; i++) {\n"
2786 " wd[i] = inotify_add_watch(fd, argv[i],\n"
2787 " IN_OPEN | IN_CLOSE);\n"
2788 " if (wd[i] == -1) {\n"
2789 " fprintf(stderr, \"Impossible de surveiller « %s » : %s\\[rs]n\",\n"
2790 " argv[i], strerror(errno));\n"
2791 " exit(EXIT_FAILURE);\n"
2792 " }\n"
2793 " }\n"
2794 "\\&\n"
2795 " /* Préparer pour la scrutation (polling). */\n"
2796 "\\&\n"
2797 " nfds = 2;\n"
2798 "\\&\n"
2799 " fds[0].fd = STDIN_FILENO; /* Entrée de console */\n"
2800 " fds[0].events = POLLIN;\n"
2801 "\\&\n"
2802 " fds[1].fd = fd; /* Entrée d'inotify */\n"
2803 " fds[1].events = POLLIN;\n"
2804 "\\&\n"
2805 " /* Attendre les événements ou une entrée du terminal. */\n"
2806 "\\&\n"
2807 " printf(\"En écoute d’événements.\\[rs]n\");\n"
2808 " while (1) {\n"
2809 " poll_num = poll(fds, nfds, -1);\n"
2810 " if (poll_num == -1) {\n"
2811 " if (errno == EINTR)\n"
2812 " continue;\n"
2813 " perror(\"poll\");\n"
2814 " exit(EXIT_FAILURE);\n"
2815 " }\n"
2816 "\\&\n"
2817 " if (poll_num E<gt> 0) {\n"
2818 "\\&\n"
2819 " if (fds[0].revents & POLLIN) {\n"
2820 "\\&\n"
2821 " /* Entrée de console disponible.\n"
2822 " Vider l’entrée standard et quitter. */\n"
2823 "\\&\n"
2824 " while (read(STDIN_FILENO, &buf, 1) E<gt> 0 && buf != \\[aq]\\[rs]n\\[aq])\n"
2825 " continue;\n"
2826 " break;\n"
2827 " }\n"
2828 "\\&\n"
2829 " if (fds[1].revents & POLLIN) {\n"
2830 "\\&\n"
2831 " /* Des événements inotify sont disponibles. */\n"
2832 "\\&\n"
2833 " handle_events(fd, wd, argc, argv);\n"
2834 " }\n"
2835 " }\n"
2836 " }\n"
2837 "\\&\n"
2838 " printf(\"Arrêt de l’écoute d’événements.\\[rs]n\");\n"
2839 "\\&\n"
2840 " /* Fermer le descripteur de fichier inotify. */\n"
2841 "\\&\n"
2842 " close(fd);\n"
2843 "\\&\n"
2844 " free(wd);\n"
2845 " exit(EXIT_SUCCESS);\n"
2846 "}\n"
2847
2848 #. type: Plain text
2849 #: debian-trixie fedora-44 fedora-rawhide
2850 msgid ""
2851 "I<Documentation/filesystems/inotify.txt> in the Linux kernel source tree"
2852 msgstr ""
2853 "I<Documentation/filesystems/inotify.txt> dans les sources du noyau Linux"
2854
2855 #. type: TH
2856 #: fedora-44 fedora-rawhide
2857 #, no-wrap
2858 msgid "2024-11-17"
2859 msgstr "17 novembre 2024"
2860
2861 #. type: TH
2862 #: fedora-44 fedora-rawhide
2863 #, no-wrap
2864 msgid "Linux man-pages 6.13"
2865 msgstr "Pages du manuel de Linux 6.13"
2866
2867 #. type: Plain text
2868 #: fedora-44 fedora-rawhide
2869 #, no-wrap
2870 msgid ""
2871 "#include E<lt>errno.hE<gt>\n"
2872 "#include E<lt>poll.hE<gt>\n"
2873 "#include E<lt>stdio.hE<gt>\n"
2874 "#include E<lt>stdlib.hE<gt>\n"
2875 "#include E<lt>sys/inotify.hE<gt>\n"
2876 "#include E<lt>unistd.hE<gt>\n"
2877 "#include E<lt>string.hE<gt>\n"
2878 "\\&\n"
2879 "/* Read all available inotify events from the file descriptor \\[aq]fd\\[aq].\n"
2880 " wd is the table of watch descriptors for the directories in argv.\n"
2881 " argc is the size of wd and argv.\n"
2882 " argv is the list of watched directories.\n"
2883 " Entry 0 of wd and argv is unused. */\n"
2884 "\\&\n"
2885 "static void\n"
2886 "handle_events(int fd, int *wd, int argc, char* argv[])\n"
2887 "{\n"
2888 " /* Some systems cannot read integer variables if they are not\n"
2889 " properly aligned. On other systems, incorrect alignment may\n"
2890 " decrease performance. Hence, the buffer used for reading from\n"
2891 " the inotify file descriptor should have the same alignment as\n"
2892 " struct inotify_event. */\n"
2893 "\\&\n"
2894 " char buf[4096]\n"
2895 " __attribute__ ((aligned(__alignof__(struct inotify_event))));\n"
2896 " const struct inotify_event *event;\n"
2897 " ssize_t size;\n"
2898 "\\&\n"
2899 " /* Loop while events can be read from inotify file descriptor. */\n"
2900 "\\&\n"
2901 " for (;;) {\n"
2902 "\\&\n"
2903 " /* Read some events. */\n"
2904 "\\&\n"
2905 " size = read(fd, buf, sizeof(buf));\n"
2906 " if (size == -1 && errno != EAGAIN) {\n"
2907 " perror(\"read\");\n"
2908 " exit(EXIT_FAILURE);\n"
2909 " }\n"
2910 "\\&\n"
2911 " /* If the nonblocking read() found no events to read, then\n"
2912 " it returns -1 with errno set to EAGAIN. In that case,\n"
2913 " we exit the loop. */\n"
2914 "\\&\n"
2915 " if (size E<lt>= 0)\n"
2916 " break;\n"
2917 "\\&\n"
2918 " /* Loop over all events in the buffer. */\n"
2919 "\\&\n"
2920 " for (char *ptr = buf; ptr E<lt> buf + size;\n"
2921 " ptr += sizeof(struct inotify_event) + event-E<gt>len) {\n"
2922 "\\&\n"
2923 " event = (const struct inotify_event *) ptr;\n"
2924 "\\&\n"
2925 " /* Print event type. */\n"
2926 "\\&\n"
2927 " if (event-E<gt>mask & IN_OPEN)\n"
2928 " printf(\"IN_OPEN: \");\n"
2929 " if (event-E<gt>mask & IN_CLOSE_NOWRITE)\n"
2930 " printf(\"IN_CLOSE_NOWRITE: \");\n"
2931 " if (event-E<gt>mask & IN_CLOSE_WRITE)\n"
2932 " printf(\"IN_CLOSE_WRITE: \");\n"
2933 "\\&\n"
2934 " /* Print the name of the watched directory. */\n"
2935 "\\&\n"
2936 " for (size_t i = 1; i E<lt> argc; ++i) {\n"
2937 " if (wd[i] == event-E<gt>wd) {\n"
2938 " printf(\"%s/\", argv[i]);\n"
2939 " break;\n"
2940 " }\n"
2941 " }\n"
2942 "\\&\n"
2943 " /* Print the name of the file. */\n"
2944 "\\&\n"
2945 " if (event-E<gt>len)\n"
2946 " printf(\"%s\", event-E<gt>name);\n"
2947 "\\&\n"
2948 " /* Print type of filesystem object. */\n"
2949 "\\&\n"
2950 " if (event-E<gt>mask & IN_ISDIR)\n"
2951 " printf(\" [directory]\\[rs]n\");\n"
2952 " else\n"
2953 " printf(\" [file]\\[rs]n\");\n"
2954 " }\n"
2955 " }\n"
2956 "}\n"
2957 "\\&\n"
2958 "int\n"
2959 "main(int argc, char* argv[])\n"
2960 "{\n"
2961 " char buf;\n"
2962 " int fd, i, poll_num;\n"
2963 " int *wd;\n"
2964 " nfds_t nfds;\n"
2965 " struct pollfd fds[2];\n"
2966 "\\&\n"
2967 " if (argc E<lt> 2) {\n"
2968 " printf(\"Usage: %s PATH [PATH ...]\\[rs]n\", argv[0]);\n"
2969 " exit(EXIT_FAILURE);\n"
2970 " }\n"
2971 "\\&\n"
2972 " printf(\"Press ENTER key to terminate.\\[rs]n\");\n"
2973 "\\&\n"
2974 " /* Create the file descriptor for accessing the inotify API. */\n"
2975 "\\&\n"
2976 " fd = inotify_init1(IN_NONBLOCK);\n"
2977 " if (fd == -1) {\n"
2978 " perror(\"inotify_init1\");\n"
2979 " exit(EXIT_FAILURE);\n"
2980 " }\n"
2981 "\\&\n"
2982 " /* Allocate memory for watch descriptors. */\n"
2983 "\\&\n"
2984 " wd = calloc(argc, sizeof(int));\n"
2985 " if (wd == NULL) {\n"
2986 " perror(\"calloc\");\n"
2987 " exit(EXIT_FAILURE);\n"
2988 " }\n"
2989 "\\&\n"
2990 " /* Mark directories for events\n"
2991 " - file was opened\n"
2992 " - file was closed */\n"
2993 "\\&\n"
2994 " for (i = 1; i E<lt> argc; i++) {\n"
2995 " wd[i] = inotify_add_watch(fd, argv[i],\n"
2996 " IN_OPEN | IN_CLOSE);\n"
2997 " if (wd[i] == -1) {\n"
2998 " fprintf(stderr, \"Cannot watch \\[aq]%s\\[aq]: %s\\[rs]n\",\n"
2999 " argv[i], strerror(errno));\n"
3000 " exit(EXIT_FAILURE);\n"
3001 " }\n"
3002 " }\n"
3003 "\\&\n"
3004 " /* Prepare for polling. */\n"
3005 "\\&\n"
3006 " nfds = 2;\n"
3007 "\\&\n"
3008 " fds[0].fd = STDIN_FILENO; /* Console input */\n"
3009 " fds[0].events = POLLIN;\n"
3010 "\\&\n"
3011 " fds[1].fd = fd; /* Inotify input */\n"
3012 " fds[1].events = POLLIN;\n"
3013 "\\&\n"
3014 " /* Wait for events and/or terminal input. */\n"
3015 "\\&\n"
3016 " printf(\"Listening for events.\\[rs]n\");\n"
3017 " while (1) {\n"
3018 " poll_num = poll(fds, nfds, -1);\n"
3019 " if (poll_num == -1) {\n"
3020 " if (errno == EINTR)\n"
3021 " continue;\n"
3022 " perror(\"poll\");\n"
3023 " exit(EXIT_FAILURE);\n"
3024 " }\n"
3025 "\\&\n"
3026 " if (poll_num E<gt> 0) {\n"
3027 "\\&\n"
3028 " if (fds[0].revents & POLLIN) {\n"
3029 "\\&\n"
3030 " /* Console input is available. Empty stdin and quit. */\n"
3031 "\\&\n"
3032 " while (read(STDIN_FILENO, &buf, 1) E<gt> 0 && buf != \\[aq]\\[rs]n\\[aq])\n"
3033 " continue;\n"
3034 " break;\n"
3035 " }\n"
3036 "\\&\n"
3037 " if (fds[1].revents & POLLIN) {\n"
3038 "\\&\n"
3039 " /* Inotify events are available. */\n"
3040 "\\&\n"
3041 " handle_events(fd, wd, argc, argv);\n"
3042 " }\n"
3043 " }\n"
3044 " }\n"
3045 "\\&\n"
3046 " printf(\"Listening for events stopped.\\[rs]n\");\n"
3047 "\\&\n"
3048 " /* Close inotify file descriptor. */\n"
3049 "\\&\n"
3050 " close(fd);\n"
3051 "\\&\n"
3052 " free(wd);\n"
3053 " exit(EXIT_SUCCESS);\n"
3054 "}\n"
3055 msgstr ""
3056 "#include E<lt>errno.hE<gt>\n"
3057 "#include E<lt>poll.hE<gt>\n"
3058 "#include E<lt>stdio.hE<gt>\n"
3059 "#include E<lt>stdlib.hE<gt>\n"
3060 "#include E<lt>sys/inotify.hE<gt>\n"
3061 "#include E<lt>unistd.hE<gt>\n"
3062 "#include E<lt>string.hE<gt>\n"
3063 "\\&\n"
3064 "/* Lire tous les événements inotify disponibles à partir du\n"
3065 " descripteur de fichier «\\ fd\\ ».\n"
3066 " wd est le tableau des descripteurs de surveillance pour\n"
3067 " les répertoires en argv.\n"
3068 " argc est la taille de wd et argv.\n"
3069 " argv est la liste des répertoires surveillés.\n"
3070 " L’entrée\\ 0 de wd et argv n’est pas utilisée. */\n"
3071 "\\&\n"
3072 "static void\n"
3073 "handle_events(int fd, int *wd, int argc, char* argv[])\n"
3074 "{\n"
3075 " /* Certains systèmes ne peuvent pas lire de variables entières\n"
3076 " si elles ne sont pas alignées correctement. Sur d’autres\n"
3077 " systèmes, un alignement incorrect pourrait diminuer les\n"
3078 " performances. Par conséquent, le tampon utilisé pour lire\n"
3079 " le descripteur de fichier inotify devrait avoir le même\n"
3080 " alignement que struct inotify_event. */\n"
3081 "\\&\n"
3082 " char buf[4096]\n"
3083 " __attribute__ ((aligned(__alignof__(struct inotify_event))));\n"
3084 " const struct inotify_event *event;\n"
3085 " ssize_t size;\n"
3086 "\\&\n"
3087 " /* Boucler tant que les événements peuvent être lus à partir du\n"
3088 " descripteur de fichier inotify */\n"
3089 "\\&\n"
3090 " for (;;) {\n"
3091 "\\&\n"
3092 " /* Lire certains événements. */\n"
3093 "\\&\n"
3094 " size = read(fd, buf, sizeof(buf));\n"
3095 " if (size == -1 && errno != EAGAIN) {\n"
3096 " perror(\"read\");\n"
3097 " exit(EXIT_FAILURE);\n"
3098 " }\n"
3099 "\\&\n"
3100 " /* Si le read() non bloquant n’a pas trouvé d’événement à\n"
3101 " lire, il renvoie -1 avec errno défini à EAGAIN. Dans ce\n"
3102 " cas, on sort de la boucle. */\n"
3103 "\\&\n"
3104 " if (size E<lt>= 0)\n"
3105 " break;\n"
3106 "\\&\n"
3107 " /* Boucler sur tous les événements du tampon. */\n"
3108 "\\&\n"
3109 " for (char *ptr = buf; ptr E<lt> buf + size;\n"
3110 " ptr += sizeof(struct inotify_event) + event-E<gt>len) {\n"
3111 "\\&\n"
3112 " event = (const struct inotify_event *) ptr;\n"
3113 "\\&\n"
3114 " /* Afficher le type d’événement. */\n"
3115 "\\&\n"
3116 " if (event-E<gt>mask & IN_OPEN)\n"
3117 " printf(\"IN_OPEN: \");\n"
3118 " if (event-E<gt>mask & IN_CLOSE_NOWRITE)\n"
3119 " printf(\"IN_CLOSE_NOWRITE: \");\n"
3120 " if (event-E<gt>mask & IN_CLOSE_WRITE)\n"
3121 " printf(\"IN_CLOSE_WRITE: \");\n"
3122 "\\&\n"
3123 " /* Afficher le nom du répertoire surveillé. */\n"
3124 "\\&\n"
3125 " for (size_t i = 1; i E<lt> argc; ++i) {\n"
3126 " if (wd[i] == event-E<gt>wd) {\n"
3127 " printf(\"%s/\", argv[i]);\n"
3128 " break;\n"
3129 " }\n"
3130 " }\n"
3131 "\\&\n"
3132 " /* Afficher le nom du fichier. */\n"
3133 "\\&\n"
3134 " if (event-E<gt>len)\n"
3135 " printf(\"%s\", event-E<gt>name);\n"
3136 "\\&\n"
3137 " /* Afficher le type d’objet de système de fichiers. */\n"
3138 "\\&\n"
3139 " if (event-E<gt>mask & IN_ISDIR)\n"
3140 " printf(\" [répertoire]\\[rs]n\");\n"
3141 " else\n"
3142 " printf(\" [fichier]\\[rs]n\");\n"
3143 " }\n"
3144 " }\n"
3145 "}\n"
3146 "\\&\n"
3147 "int\n"
3148 "main(int argc, char* argv[])\n"
3149 "{\n"
3150 " char buf;\n"
3151 " int fd, i, poll_num;\n"
3152 " int *wd;\n"
3153 " nfds_t nfds;\n"
3154 " struct pollfd fds[2];\n"
3155 "\\&\n"
3156 " if (argc E<lt> 2) {\n"
3157 " printf(\"\"Utilisation\\ : %s CHEMIN [CHEMIN ...]\\[rs]n\", argv[0]);\n"
3158 " exit(EXIT_FAILURE);\n"
3159 " }\n"
3160 "\\&\n"
3161 " printf(\"Appuyer sur la touche Entrée pour quitter.\\[rs]n\");\n"
3162 "\\&\n"
3163 " /* Créer le descripteur de fichier pour accéder à l’interface de\n"
3164 " programmation inotify. */\n"
3165 "\\&\n"
3166 " fd = inotify_init1(IN_NONBLOCK);\n"
3167 " if (fd == -1) {\n"
3168 " perror(\"inotify_init1\");\n"
3169 " exit(EXIT_FAILURE);\n"
3170 " }\n"
3171 "\\&\n"
3172 " /* Allouer la mémoire pour les descripteurs de surveillance. */\n"
3173 "\\&\n"
3174 " wd = calloc(argc, sizeof(int));\n"
3175 " if (wd == NULL) {\n"
3176 " perror(\"calloc\");\n"
3177 " exit(EXIT_FAILURE);\n"
3178 " }\n"
3179 "\\&\n"
3180 " /* Marquer les répertoires pour les événements :\n"
3181 " - un fichier a été ouvert ;\n"
3182 " - un fichier a été fermé\n"
3183 "\\&\n"
3184 " for (i = 1; i E<lt> argc; i++) {\n"
3185 " wd[i] = inotify_add_watch(fd, argv[i],\n"
3186 " IN_OPEN | IN_CLOSE);\n"
3187 " if (wd[i] == -1) {\n"
3188 " fprintf(stderr, \"Impossible de surveiller « %s » : %s\\[rs]n\",\n"
3189 " argv[i], strerror(errno));\n"
3190 " exit(EXIT_FAILURE);\n"
3191 " }\n"
3192 " }\n"
3193 "\\&\n"
3194 " /* Préparer pour la scrutation (polling). */\n"
3195 "\\&\n"
3196 " nfds = 2;\n"
3197 "\\&\n"
3198 " fds[0].fd = STDIN_FILENO; /* Entrée de console */\n"
3199 " fds[0].events = POLLIN;\n"
3200 "\\&\n"
3201 " fds[1].fd = fd; /* Entrée d'inotify */\n"
3202 " fds[1].events = POLLIN;\n"
3203 "\\&\n"
3204 " /* Attendre les événements ou une entrée du terminal. */\n"
3205 "\\&\n"
3206 " printf(\"En écoute d’événements.\\[rs]n\");\n"
3207 " while (1) {\n"
3208 " poll_num = poll(fds, nfds, -1);\n"
3209 " if (poll_num == -1) {\n"
3210 " if (errno == EINTR)\n"
3211 " continue;\n"
3212 " perror(\"poll\");\n"
3213 " exit(EXIT_FAILURE);\n"
3214 " }\n"
3215 "\\&\n"
3216 " if (poll_num E<gt> 0) {\n"
3217 "\\&\n"
3218 " if (fds[0].revents & POLLIN) {\n"
3219 "\\&\n"
3220 " /* Entrée de console disponible.\n"
3221 " Vider l’entrée standard et quitter. */\n"
3222 "\\&\n"
3223 " while (read(STDIN_FILENO, &buf, 1) E<gt> 0 && buf != \\[aq]\\[rs]n\\[aq])\n"
3224 " continue;\n"
3225 " break;\n"
3226 " }\n"
3227 "\\&\n"
3228 " if (fds[1].revents & POLLIN) {\n"
3229 "\\&\n"
3230 " /* Des événements inotify sont disponibles. */\n"
3231 "\\&\n"
3232 " handle_events(fd, wd, argc, argv);\n"
3233 " }\n"
3234 " }\n"
3235 " }\n"
3236 "\\&\n"
3237 " printf(\"Arrêt de l’écoute d’événements.\\[rs]n\");\n"
3238 "\\&\n"
3239 " /* Fermer le descripteur de fichier inotify. */\n"
3240 "\\&\n"
3241 " close(fd);\n"
3242 "\\&\n"
3243 " free(wd);\n"
3244 " exit(EXIT_SUCCESS);\n"
3245 "}\n"
3246
3247 #. type: TH
3248 #: mageia-cauldron
3249 #, no-wrap
3250 msgid "2026-02-08"
3251 msgstr "8 février 2026"
3252
3253 #. type: TH
3254 #: mageia-cauldron
3255 #, no-wrap
3256 msgid "Linux man-pages 6.17"
3257 msgstr "Pages du manuel de Linux 6.17"
3258
3259 #. type: Plain text
3260 #: mageia-cauldron
3261 #, fuzzy, no-wrap
3262 #| msgid ""
3263 #| "#include E<lt>errno.hE<gt>\n"
3264 #| "#include E<lt>poll.hE<gt>\n"
3265 #| "#include E<lt>stdio.hE<gt>\n"
3266 #| "#include E<lt>stdlib.hE<gt>\n"
3267 #| "#include E<lt>sys/inotify.hE<gt>\n"
3268 #| "#include E<lt>unistd.hE<gt>\n"
3269 #| "#include E<lt>string.hE<gt>\n"
3270 #| "\\&\n"
3271 #| "/* Read all available inotify events from the file descriptor \\[aq]fd\\[aq].\n"
3272 #| " wd is the table of watch descriptors for the directories in argv.\n"
3273 #| " argc is the size of wd and argv.\n"
3274 #| " argv is the list of watched directories.\n"
3275 #| " Entry 0 of wd and argv is unused. */\n"
3276 #| "\\&\n"
3277 #| "static void\n"
3278 #| "handle_events(int fd, int *wd, int argc, char* argv[])\n"
3279 #| "{\n"
3280 #| " /* Some systems cannot read integer variables if they are not\n"
3281 #| " properly aligned. On other systems, incorrect alignment may\n"
3282 #| " decrease performance. Hence, the buffer used for reading from\n"
3283 #| " the inotify file descriptor should have the same alignment as\n"
3284 #| " struct inotify_event. */\n"
3285 #| "\\&\n"
3286 #| " char buf[4096]\n"
3287 #| " __attribute__ ((aligned(__alignof__(struct inotify_event))));\n"
3288 #| " const struct inotify_event *event;\n"
3289 #| " ssize_t size;\n"
3290 #| "\\&\n"
3291 #| " /* Loop while events can be read from inotify file descriptor. */\n"
3292 #| "\\&\n"
3293 #| " for (;;) {\n"
3294 #| "\\&\n"
3295 #| " /* Read some events. */\n"
3296 #| "\\&\n"
3297 #| " size = read(fd, buf, sizeof(buf));\n"
3298 #| " if (size == -1 && errno != EAGAIN) {\n"
3299 #| " perror(\"read\");\n"
3300 #| " exit(EXIT_FAILURE);\n"
3301 #| " }\n"
3302 #| "\\&\n"
3303 #| " /* If the nonblocking read() found no events to read, then\n"
3304 #| " it returns -1 with errno set to EAGAIN. In that case,\n"
3305 #| " we exit the loop. */\n"
3306 #| "\\&\n"
3307 #| " if (size E<lt>= 0)\n"
3308 #| " break;\n"
3309 #| "\\&\n"
3310 #| " /* Loop over all events in the buffer. */\n"
3311 #| "\\&\n"
3312 #| " for (char *ptr = buf; ptr E<lt> buf + size;\n"
3313 #| " ptr += sizeof(struct inotify_event) + event-E<gt>len) {\n"
3314 #| "\\&\n"
3315 #| " event = (const struct inotify_event *) ptr;\n"
3316 #| "\\&\n"
3317 #| " /* Print event type. */\n"
3318 #| "\\&\n"
3319 #| " if (event-E<gt>mask & IN_OPEN)\n"
3320 #| " printf(\"IN_OPEN: \");\n"
3321 #| " if (event-E<gt>mask & IN_CLOSE_NOWRITE)\n"
3322 #| " printf(\"IN_CLOSE_NOWRITE: \");\n"
3323 #| " if (event-E<gt>mask & IN_CLOSE_WRITE)\n"
3324 #| " printf(\"IN_CLOSE_WRITE: \");\n"
3325 #| "\\&\n"
3326 #| " /* Print the name of the watched directory. */\n"
3327 #| "\\&\n"
3328 #| " for (size_t i = 1; i E<lt> argc; ++i) {\n"
3329 #| " if (wd[i] == event-E<gt>wd) {\n"
3330 #| " printf(\"%s/\", argv[i]);\n"
3331 #| " break;\n"
3332 #| " }\n"
3333 #| " }\n"
3334 #| "\\&\n"
3335 #| " /* Print the name of the file. */\n"
3336 #| "\\&\n"
3337 #| " if (event-E<gt>len)\n"
3338 #| " printf(\"%s\", event-E<gt>name);\n"
3339 #| "\\&\n"
3340 #| " /* Print type of filesystem object. */\n"
3341 #| "\\&\n"
3342 #| " if (event-E<gt>mask & IN_ISDIR)\n"
3343 #| " printf(\" [directory]\\[rs]n\");\n"
3344 #| " else\n"
3345 #| " printf(\" [file]\\[rs]n\");\n"
3346 #| " }\n"
3347 #| " }\n"
3348 #| "}\n"
3349 #| "\\&\n"
3350 #| "int\n"
3351 #| "main(int argc, char* argv[])\n"
3352 #| "{\n"
3353 #| " char buf;\n"
3354 #| " int fd, i, poll_num;\n"
3355 #| " int *wd;\n"
3356 #| " nfds_t nfds;\n"
3357 #| " struct pollfd fds[2];\n"
3358 #| "\\&\n"
3359 #| " if (argc E<lt> 2) {\n"
3360 #| " printf(\"Usage: %s PATH [PATH ...]\\[rs]n\", argv[0]);\n"
3361 #| " exit(EXIT_FAILURE);\n"
3362 #| " }\n"
3363 #| "\\&\n"
3364 #| " printf(\"Press ENTER key to terminate.\\[rs]n\");\n"
3365 #| "\\&\n"
3366 #| " /* Create the file descriptor for accessing the inotify API. */\n"
3367 #| "\\&\n"
3368 #| " fd = inotify_init1(IN_NONBLOCK);\n"
3369 #| " if (fd == -1) {\n"
3370 #| " perror(\"inotify_init1\");\n"
3371 #| " exit(EXIT_FAILURE);\n"
3372 #| " }\n"
3373 #| "\\&\n"
3374 #| " /* Allocate memory for watch descriptors. */\n"
3375 #| "\\&\n"
3376 #| " wd = calloc(argc, sizeof(int));\n"
3377 #| " if (wd == NULL) {\n"
3378 #| " perror(\"calloc\");\n"
3379 #| " exit(EXIT_FAILURE);\n"
3380 #| " }\n"
3381 #| "\\&\n"
3382 #| " /* Mark directories for events\n"
3383 #| " - file was opened\n"
3384 #| " - file was closed */\n"
3385 #| "\\&\n"
3386 #| " for (i = 1; i E<lt> argc; i++) {\n"
3387 #| " wd[i] = inotify_add_watch(fd, argv[i],\n"
3388 #| " IN_OPEN | IN_CLOSE);\n"
3389 #| " if (wd[i] == -1) {\n"
3390 #| " fprintf(stderr, \"Cannot watch \\[aq]%s\\[aq]: %s\\[rs]n\",\n"
3391 #| " argv[i], strerror(errno));\n"
3392 #| " exit(EXIT_FAILURE);\n"
3393 #| " }\n"
3394 #| " }\n"
3395 #| "\\&\n"
3396 #| " /* Prepare for polling. */\n"
3397 #| "\\&\n"
3398 #| " nfds = 2;\n"
3399 #| "\\&\n"
3400 #| " fds[0].fd = STDIN_FILENO; /* Console input */\n"
3401 #| " fds[0].events = POLLIN;\n"
3402 #| "\\&\n"
3403 #| " fds[1].fd = fd; /* Inotify input */\n"
3404 #| " fds[1].events = POLLIN;\n"
3405 #| "\\&\n"
3406 #| " /* Wait for events and/or terminal input. */\n"
3407 #| "\\&\n"
3408 #| " printf(\"Listening for events.\\[rs]n\");\n"
3409 #| " while (1) {\n"
3410 #| " poll_num = poll(fds, nfds, -1);\n"
3411 #| " if (poll_num == -1) {\n"
3412 #| " if (errno == EINTR)\n"
3413 #| " continue;\n"
3414 #| " perror(\"poll\");\n"
3415 #| " exit(EXIT_FAILURE);\n"
3416 #| " }\n"
3417 #| "\\&\n"
3418 #| " if (poll_num E<gt> 0) {\n"
3419 #| "\\&\n"
3420 #| " if (fds[0].revents & POLLIN) {\n"
3421 #| "\\&\n"
3422 #| " /* Console input is available. Empty stdin and quit. */\n"
3423 #| "\\&\n"
3424 #| " while (read(STDIN_FILENO, &buf, 1) E<gt> 0 && buf != \\[aq]\\[rs]n\\[aq])\n"
3425 #| " continue;\n"
3426 #| " break;\n"
3427 #| " }\n"
3428 #| "\\&\n"
3429 #| " if (fds[1].revents & POLLIN) {\n"
3430 #| "\\&\n"
3431 #| " /* Inotify events are available. */\n"
3432 #| "\\&\n"
3433 #| " handle_events(fd, wd, argc, argv);\n"
3434 #| " }\n"
3435 #| " }\n"
3436 #| " }\n"
3437 #| "\\&\n"
3438 #| " printf(\"Listening for events stopped.\\[rs]n\");\n"
3439 #| "\\&\n"
3440 #| " /* Close inotify file descriptor. */\n"
3441 #| "\\&\n"
3442 #| " close(fd);\n"
3443 #| "\\&\n"
3444 #| " free(wd);\n"
3445 #| " exit(EXIT_SUCCESS);\n"
3446 #| "}\n"
3447 msgid ""
3448 "#include E<lt>errno.hE<gt>\n"
3449 "#include E<lt>poll.hE<gt>\n"
3450 "#include E<lt>stdio.hE<gt>\n"
3451 "#include E<lt>stdlib.hE<gt>\n"
3452 "#include E<lt>sys/inotify.hE<gt>\n"
3453 "#include E<lt>unistd.hE<gt>\n"
3454 "#include E<lt>string.hE<gt>\n"
3455 "\\&\n"
3456 "/* Read all available inotify events from the file descriptor \\[aq]fd\\[aq].\n"
3457 " wd is the table of watch descriptors for the directories in argv.\n"
3458 " argc is the size of wd and argv.\n"
3459 " argv is the list of watched directories.\n"
3460 " Entry 0 of wd and argv is unused. */\n"
3461 "\\&\n"
3462 "static void\n"
3463 "handle_events(int fd, int *wd, int argc, char* argv[])\n"
3464 "{\n"
3465 " /* Some systems cannot read integer variables if they are not\n"
3466 " properly aligned. On other systems, incorrect alignment may\n"
3467 " decrease performance. Hence, the buffer used for reading from\n"
3468 " the inotify file descriptor should have the same alignment as\n"
3469 " struct inotify_event. */\n"
3470 "\\&\n"
3471 " char buf[4096]\n"
3472 " __attribute__ ((aligned(__alignof__(struct inotify_event))));\n"
3473 " const struct inotify_event *event;\n"
3474 " ssize_t size;\n"
3475 "\\&\n"
3476 " /* Loop while events can be read from inotify file descriptor. */\n"
3477 "\\&\n"
3478 " for (;;) {\n"
3479 "\\&\n"
3480 " /* Read some events. */\n"
3481 "\\&\n"
3482 " size = read(fd, buf, sizeof(buf));\n"
3483 " if (size == -1 && errno != EAGAIN) {\n"
3484 " perror(\"read\");\n"
3485 " exit(EXIT_FAILURE);\n"
3486 " }\n"
3487 "\\&\n"
3488 " /* If the nonblocking read() found no events to read, then\n"
3489 " it returns -1 with errno set to EAGAIN. In that case,\n"
3490 " we exit the loop. */\n"
3491 "\\&\n"
3492 " if (size E<lt>= 0)\n"
3493 " break;\n"
3494 "\\&\n"
3495 " /* Loop over all events in the buffer. */\n"
3496 "\\&\n"
3497 " for (char *ptr = buf; ptr E<lt> buf + size;\n"
3498 " ptr += sizeof(struct inotify_event) + event-E<gt>len) {\n"
3499 "\\&\n"
3500 " event = (const struct inotify_event *) ptr;\n"
3501 "\\&\n"
3502 " /* Print event type. */\n"
3503 "\\&\n"
3504 " if (event-E<gt>mask & IN_OPEN)\n"
3505 " printf(\"IN_OPEN: \");\n"
3506 " if (event-E<gt>mask & IN_CLOSE_NOWRITE)\n"
3507 " printf(\"IN_CLOSE_NOWRITE: \");\n"
3508 " if (event-E<gt>mask & IN_CLOSE_WRITE)\n"
3509 " printf(\"IN_CLOSE_WRITE: \");\n"
3510 "\\&\n"
3511 " /* Print the name of the watched directory. */\n"
3512 "\\&\n"
3513 " for (size_t i = 1; i E<lt> argc; ++i) {\n"
3514 " if (wd[i] == event-E<gt>wd) {\n"
3515 " printf(\"%s/\", argv[i]);\n"
3516 " break;\n"
3517 " }\n"
3518 " }\n"
3519 "\\&\n"
3520 " /* Print the name of the file. */\n"
3521 "\\&\n"
3522 " if (event-E<gt>len)\n"
3523 " printf(\"%s\", event-E<gt>name);\n"
3524 "\\&\n"
3525 " /* Print type of filesystem object. */\n"
3526 "\\&\n"
3527 " if (event-E<gt>mask & IN_ISDIR)\n"
3528 " printf(\" [directory]\\[rs]n\");\n"
3529 " else\n"
3530 " printf(\" [file]\\[rs]n\");\n"
3531 " }\n"
3532 " }\n"
3533 "}\n"
3534 "\\&\n"
3535 "int\n"
3536 "main(int argc, char* argv[])\n"
3537 "{\n"
3538 " char buf;\n"
3539 " int fd, i, poll_num;\n"
3540 " int *wd;\n"
3541 " nfds_t nfds;\n"
3542 " struct pollfd fds[2];\n"
3543 "\\&\n"
3544 " if (argc E<lt> 2) {\n"
3545 " printf(\"Usage: %s PATH [PATH ...]\\[rs]n\", argv[0]);\n"
3546 " exit(EXIT_FAILURE);\n"
3547 " }\n"
3548 "\\&\n"
3549 " printf(\"Press ENTER key to terminate.\\[rs]n\");\n"
3550 "\\&\n"
3551 " /* Create the file descriptor for accessing the inotify API. */\n"
3552 "\\&\n"
3553 " fd = inotify_init1(IN_NONBLOCK);\n"
3554 " if (fd == -1) {\n"
3555 " perror(\"inotify_init1\");\n"
3556 " exit(EXIT_FAILURE);\n"
3557 " }\n"
3558 "\\&\n"
3559 " /* Allocate memory for watch descriptors. */\n"
3560 "\\&\n"
3561 " wd = calloc(argc, sizeof(int));\n"
3562 " if (wd == NULL) {\n"
3563 " perror(\"calloc\");\n"
3564 " exit(EXIT_FAILURE);\n"
3565 " }\n"
3566 "\\&\n"
3567 " /* Mark directories for events\n"
3568 " - file was opened\n"
3569 " - file was closed */\n"
3570 "\\&\n"
3571 " for (i = 1; i E<lt> argc; i++) {\n"
3572 " wd[i] = inotify_add_watch(fd, argv[i],\n"
3573 " IN_OPEN | IN_CLOSE);\n"
3574 " if (wd[i] == -1) {\n"
3575 " fprintf(stderr, \"Cannot watch \\[aq]%s\\[aq]: %s\\[rs]n\",\n"
3576 " argv[i], strerror(errno));\n"
3577 " exit(EXIT_FAILURE);\n"
3578 " }\n"
3579 " }\n"
3580 "\\&\n"
3581 " /* Prepare for polling. */\n"
3582 "\\&\n"
3583 " nfds = 2;\n"
3584 "\\&\n"
3585 " fds[0].fd = STDIN_FILENO; /* Console input */\n"
3586 " fds[0].events = POLLIN;\n"
3587 "\\&\n"
3588 " fds[1].fd = fd; /* Inotify input */\n"
3589 " fds[1].events = POLLIN;\n"
3590 "\\&\n"
3591 " /* Wait for events and/or terminal input. */\n"
3592 "\\&\n"
3593 " printf(\"Listening for events.\\[rs]n\");\n"
3594 " while (1) {\n"
3595 " poll_num = poll(fds, nfds, -1);\n"
3596 " if (poll_num == -1) {\n"
3597 " if (errno == EINTR)\n"
3598 " continue;\n"
3599 " perror(\"poll\");\n"
3600 " exit(EXIT_FAILURE);\n"
3601 " }\n"
3602 "\\&\n"
3603 " if (poll_num E<gt> 0) {\n"
3604 "\\&\n"
3605 " if (fds[0].revents & POLLIN) {\n"
3606 "\\&\n"
3607 " /* Console input is available. Empty stdin and quit. */\n"
3608 "\\&\n"
3609 " while (read(STDIN_FILENO, &buf, 1) E<gt> 0 && buf != \\[aq]\\[rs]n\\[aq])\n"
3610 " continue;\n"
3611 " break;\n"
3612 " }\n"
3613 "\\&\n"
3614 " if (fds[1].revents & POLLIN) {\n"
3615 "\\&\n"
3616 " /* Inotify events are available. */\n"
3617 "\\&\n"
3618 " handle_events(fd, wd, argc, argv);\n"
3619 " }\n"
3620 " }\n"
3621 " }\n"
3622 "\\&\n"
3623 " printf(\"Listening for events stopped.\\[rs]n\");\n"
3624 "\\&\n"
3625 " /* Close inotify file descriptor. */\n"
3626 "\\&\n"
3627 " close(fd);\n"
3628 "\\&\n"
3629 " free(wd);\n"
3630 " exit(EXIT_SUCCESS);\n"
3631 "}\n"
3632 msgstr ""
3633 "#include E<lt>errno.hE<gt>\n"
3634 "#include E<lt>poll.hE<gt>\n"
3635 "#include E<lt>stdio.hE<gt>\n"
3636 "#include E<lt>stdlib.hE<gt>\n"
3637 "#include E<lt>sys/inotify.hE<gt>\n"
3638 "#include E<lt>unistd.hE<gt>\n"
3639 "#include E<lt>string.hE<gt>\n"
3640 "\\&\n"
3641 "/* Lire tous les événements inotify disponibles à partir du\n"
3642 " descripteur de fichier «\\ fd\\ ».\n"
3643 " wd est le tableau des descripteurs de surveillance pour\n"
3644 " les répertoires en argv.\n"
3645 " argc est la taille de wd et argv.\n"
3646 " argv est la liste des répertoires surveillés.\n"
3647 " L’entrée\\ 0 de wd et argv n’est pas utilisée. */\n"
3648 "\\&\n"
3649 "static void\n"
3650 "handle_events(int fd, int *wd, int argc, char* argv[])\n"
3651 "{\n"
3652 " /* Certains systèmes ne peuvent pas lire de variables entières\n"
3653 " si elles ne sont pas alignées correctement. Sur d’autres\n"
3654 " systèmes, un alignement incorrect pourrait diminuer les\n"
3655 " performances. Par conséquent, le tampon utilisé pour lire\n"
3656 " le descripteur de fichier inotify devrait avoir le même\n"
3657 " alignement que struct inotify_event. */\n"
3658 "\\&\n"
3659 " char buf[4096]\n"
3660 " __attribute__ ((aligned(__alignof__(struct inotify_event))));\n"
3661 " const struct inotify_event *event;\n"
3662 " ssize_t size;\n"
3663 "\\&\n"
3664 " /* Boucler tant que les événements peuvent être lus à partir du\n"
3665 " descripteur de fichier inotify */\n"
3666 "\\&\n"
3667 " for (;;) {\n"
3668 "\\&\n"
3669 " /* Lire certains événements. */\n"
3670 "\\&\n"
3671 " size = read(fd, buf, sizeof(buf));\n"
3672 " if (size == -1 && errno != EAGAIN) {\n"
3673 " perror(\"read\");\n"
3674 " exit(EXIT_FAILURE);\n"
3675 " }\n"
3676 "\\&\n"
3677 " /* Si le read() non bloquant n’a pas trouvé d’événement à\n"
3678 " lire, il renvoie -1 avec errno défini à EAGAIN. Dans ce\n"
3679 " cas, on sort de la boucle. */\n"
3680 "\\&\n"
3681 " if (size E<lt>= 0)\n"
3682 " break;\n"
3683 "\\&\n"
3684 " /* Boucler sur tous les événements du tampon. */\n"
3685 "\\&\n"
3686 " for (char *ptr = buf; ptr E<lt> buf + size;\n"
3687 " ptr += sizeof(struct inotify_event) + event-E<gt>len) {\n"
3688 "\\&\n"
3689 " event = (const struct inotify_event *) ptr;\n"
3690 "\\&\n"
3691 " /* Afficher le type d’événement. */\n"
3692 "\\&\n"
3693 " if (event-E<gt>mask & IN_OPEN)\n"
3694 " printf(\"IN_OPEN: \");\n"
3695 " if (event-E<gt>mask & IN_CLOSE_NOWRITE)\n"
3696 " printf(\"IN_CLOSE_NOWRITE: \");\n"
3697 " if (event-E<gt>mask & IN_CLOSE_WRITE)\n"
3698 " printf(\"IN_CLOSE_WRITE: \");\n"
3699 "\\&\n"
3700 " /* Afficher le nom du répertoire surveillé. */\n"
3701 "\\&\n"
3702 " for (size_t i = 1; i E<lt> argc; ++i) {\n"
3703 " if (wd[i] == event-E<gt>wd) {\n"
3704 " printf(\"%s/\", argv[i]);\n"
3705 " break;\n"
3706 " }\n"
3707 " }\n"
3708 "\\&\n"
3709 " /* Afficher le nom du fichier. */\n"
3710 "\\&\n"
3711 " if (event-E<gt>len)\n"
3712 " printf(\"%s\", event-E<gt>name);\n"
3713 "\\&\n"
3714 " /* Afficher le type d’objet de système de fichiers. */\n"
3715 "\\&\n"
3716 " if (event-E<gt>mask & IN_ISDIR)\n"
3717 " printf(\" [répertoire]\\[rs]n\");\n"
3718 " else\n"
3719 " printf(\" [fichier]\\[rs]n\");\n"
3720 " }\n"
3721 " }\n"
3722 "}\n"
3723 "\\&\n"
3724 "int\n"
3725 "main(int argc, char* argv[])\n"
3726 "{\n"
3727 " char buf;\n"
3728 " int fd, i, poll_num;\n"
3729 " int *wd;\n"
3730 " nfds_t nfds;\n"
3731 " struct pollfd fds[2];\n"
3732 "\\&\n"
3733 " if (argc E<lt> 2) {\n"
3734 " printf(\"\"Utilisation\\ : %s CHEMIN [CHEMIN ...]\\[rs]n\", argv[0]);\n"
3735 " exit(EXIT_FAILURE);\n"
3736 " }\n"
3737 "\\&\n"
3738 " printf(\"Appuyer sur la touche Entrée pour quitter.\\[rs]n\");\n"
3739 "\\&\n"
3740 " /* Créer le descripteur de fichier pour accéder à l’interface de\n"
3741 " programmation inotify. */\n"
3742 "\\&\n"
3743 " fd = inotify_init1(IN_NONBLOCK);\n"
3744 " if (fd == -1) {\n"
3745 " perror(\"inotify_init1\");\n"
3746 " exit(EXIT_FAILURE);\n"
3747 " }\n"
3748 "\\&\n"
3749 " /* Allouer la mémoire pour les descripteurs de surveillance. */\n"
3750 "\\&\n"
3751 " wd = calloc(argc, sizeof(int));\n"
3752 " if (wd == NULL) {\n"
3753 " perror(\"calloc\");\n"
3754 " exit(EXIT_FAILURE);\n"
3755 " }\n"
3756 "\\&\n"
3757 " /* Marquer les répertoires pour les événements :\n"
3758 " - un fichier a été ouvert ;\n"
3759 " - un fichier a été fermé\n"
3760 "\\&\n"
3761 " for (i = 1; i E<lt> argc; i++) {\n"
3762 " wd[i] = inotify_add_watch(fd, argv[i],\n"
3763 " IN_OPEN | IN_CLOSE);\n"
3764 " if (wd[i] == -1) {\n"
3765 " fprintf(stderr, \"Impossible de surveiller « %s » : %s\\[rs]n\",\n"
3766 " argv[i], strerror(errno));\n"
3767 " exit(EXIT_FAILURE);\n"
3768 " }\n"
3769 " }\n"
3770 "\\&\n"
3771 " /* Préparer pour la scrutation (polling). */\n"
3772 "\\&\n"
3773 " nfds = 2;\n"
3774 "\\&\n"
3775 " fds[0].fd = STDIN_FILENO; /* Entrée de console */\n"
3776 " fds[0].events = POLLIN;\n"
3777 "\\&\n"
3778 " fds[1].fd = fd; /* Entrée d'inotify */\n"
3779 " fds[1].events = POLLIN;\n"
3780 "\\&\n"
3781 " /* Attendre les événements ou une entrée du terminal. */\n"
3782 "\\&\n"
3783 " printf(\"En écoute d’événements.\\[rs]n\");\n"
3784 " while (1) {\n"
3785 " poll_num = poll(fds, nfds, -1);\n"
3786 " if (poll_num == -1) {\n"
3787 " if (errno == EINTR)\n"
3788 " continue;\n"
3789 " perror(\"poll\");\n"
3790 " exit(EXIT_FAILURE);\n"
3791 " }\n"
3792 "\\&\n"
3793 " if (poll_num E<gt> 0) {\n"
3794 "\\&\n"
3795 " if (fds[0].revents & POLLIN) {\n"
3796 "\\&\n"
3797 " /* Entrée de console disponible.\n"
3798 " Vider l’entrée standard et quitter. */\n"
3799 "\\&\n"
3800 " while (read(STDIN_FILENO, &buf, 1) E<gt> 0 && buf != \\[aq]\\[rs]n\\[aq])\n"
3801 " continue;\n"
3802 " break;\n"
3803 " }\n"
3804 "\\&\n"
3805 " if (fds[1].revents & POLLIN) {\n"
3806 "\\&\n"
3807 " /* Des événements inotify sont disponibles. */\n"
3808 "\\&\n"
3809 " handle_events(fd, wd, argc, argv);\n"
3810 " }\n"
3811 " }\n"
3812 " }\n"
3813 "\\&\n"
3814 " printf(\"Arrêt de l’écoute d’événements.\\[rs]n\");\n"
3815 "\\&\n"
3816 " /* Fermer le descripteur de fichier inotify. */\n"
3817 "\\&\n"
3818 " close(fd);\n"
3819 "\\&\n"
3820 " free(wd);\n"
3821 " exit(EXIT_SUCCESS);\n"
3822 "}\n"
3823
3824 #. type: TH
3825 #: opensuse-leap-16-1 opensuse-tumbleweed
3826 #, no-wrap
3827 msgid "Linux man-pages (unreleased)"
3828 msgstr "Pages du manuel de Linux (non publiées)"