Debian Codegraph @

po/ar/man7/inotify.7.po

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