#, fuzzy msgid "" msgstr "" "Project-Id-Version: man-pages-l10n VERSION\n" "POT-Creation-Date: 2014-07-17 17:57+0900\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #. type: TH #: man-pages/man7/inotify.7:27 #, no-wrap msgid "INOTIFY" msgstr "" #. type: TH #: man-pages/man7/inotify.7:27 #, no-wrap msgid "2014-07-08" msgstr "" #. type: TH #: man-pages/man7/inotify.7:27 #, no-wrap msgid "Linux" msgstr "" #. type: TH #: man-pages/man7/inotify.7:27 #, no-wrap msgid "Linux Programmer's Manual" msgstr "" #. type: SH #: man-pages/man7/inotify.7:28 #, no-wrap msgid "NAME" msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:30 msgid "inotify - monitoring filesystem events" msgstr "" #. type: SH #: man-pages/man7/inotify.7:30 #, no-wrap msgid "DESCRIPTION" msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:38 msgid "" "The I API provides a mechanism for monitoring filesystem events. " "Inotify can be used to monitor individual files, or to monitor directories. " "When a directory is monitored, inotify will return events for the directory " "itself, and for files inside the directory." msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:40 msgid "The following system calls are used with this API:" msgstr "" #. type: IP #: man-pages/man7/inotify.7:40 man-pages/man7/inotify.7:51 man-pages/man7/inotify.7:64 man-pages/man7/inotify.7:70 man-pages/man7/inotify.7:73 man-pages/man7/inotify.7:270 man-pages/man7/inotify.7:273 #, no-wrap msgid "*" msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:51 msgid "" "B(2) creates an inotify instance and returns a file " "descriptor referring to the inotify instance. The more recent " "B(2) is like B(2), but has a I argument " "that provides access to some extra functionality." msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:64 msgid "" "B(2) manipulates the \"watch list\" associated with an " "inotify instance. Each item (\"watch\") in the watch list specifies the " "pathname of a file or directory, along with some set of events that the " "kernel should monitor for the file referred to by that pathname. " "B(2) either creates a new watch item, or modifies an " "existing watch. Each watch has a unique \"watch descriptor\", an integer " "returned by B(2) when the watch is created." msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:70 msgid "" "When events occur for monitored files and directories, those events are made " "available to the application as structured data that can be read from the " "inotify file descriptor using B(2) (see below)." msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:73 msgid "B(2) removes an item from an inotify watch list." msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:80 msgid "" "When all file descriptors referring to an inotify instance have been closed " "(using B(2)), the underlying object and its resources are freed for " "reuse by the kernel; all associated watches are automatically freed." msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:89 msgid "" "With careful programming, an application can use inotify to efficiently " "monitor and cache the state of a set of filesystem objects. However, robust " "applications should allow for the fact that bugs in the monitoring logic or " "races of the kind described below may leave the cache inconsistent with the " "filesystem state. It is probably wise to to do some consistency checking, " "and rebuild the cache when inconsistencies are detected." msgstr "" #. type: SS #: man-pages/man7/inotify.7:89 #, no-wrap msgid "Reading events from an inotify file descriptor" msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:102 msgid "" "To determine what events have occurred, an application B(2)s from the " "inotify file descriptor. If no events have so far occurred, then, assuming " "a blocking file descriptor, B(2) will block until at least one event " "occurs (unless interrupted by a signal, in which case the call fails with " "the error B; see B(7))." msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:106 msgid "" "Each successful B(2) returns a buffer containing one or more of the " "following structures:" msgstr "" #. FIXME . The type of the 'wd' field should probably be "int32_t". #. I submitted a patch to fix this. See the LKML thread #. "[patch] Fix type errors in inotify interfaces", 18 Nov 2008 #. Glibc bug filed: http://sources.redhat.com/bugzilla/show_bug.cgi?id=7040 #. type: Plain text #: man-pages/man7/inotify.7:121 #, no-wrap msgid "" "struct inotify_event {\n" " int wd; /* Watch descriptor */\n" " uint32_t mask; /* Mask describing event */\n" " uint32_t cookie; /* Unique cookie associating related\n" " events (for rename(2)) */\n" " uint32_t len; /* Size of I field */\n" " char name[]; /* Optional null-terminated name */\n" "};\n" msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:128 msgid "" "I identifies the watch for which this event occurs. It is one of the " "watch descriptors returned by a previous call to B(2)." msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:131 msgid "" "I contains bits that describe the event that occurred (see below)." msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:143 msgid "" "I is a unique integer that connects related events. Currently this " "is used only for rename events, and allows the resulting pair of " "B and B events to be connected by the " "application. For all other event types, I is set to 0." msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:152 msgid "" "The I field is present only when an event is returned for a file " "inside a watched directory; it identifies the file pathname relative to the " "watched directory. This pathname is null-terminated, and may include " "further null bytes (\\(aq\\e0\\(aq) to align subsequent reads to a suitable " "address boundary." msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:162 msgid "" "The I field counts all of the bytes in I, including the null " "bytes; the length of each I structure is thus I." msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:173 msgid "" "The behavior when the buffer given to B(2) is too small to return " "information about the next event depends on the kernel version: in kernels " "before 2.6.21, B(2) returns 0; since kernel 2.6.21, B(2) fails " "with the error B. Specifying a buffer of size" msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:175 #, no-wrap msgid " sizeof(struct inotify_event) + NAME_MAX + 1\n" msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:177 msgid "will be sufficient to read at least one event." msgstr "" #. type: SS #: man-pages/man7/inotify.7:177 #, no-wrap msgid "inotify events" msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:197 msgid "" "The B(2) I argument and the I field of the " "I structure returned when B(2)ing an inotify file " "descriptor are both bit masks identifying inotify events. The following " "bits can be specified in I when calling B(2) and " "may be returned in the I field returned by B(2):" msgstr "" #. type: TP #: man-pages/man7/inotify.7:198 #, no-wrap msgid "B (*)" msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:203 msgid "File was accessed (e.g., B(2), B(2))." msgstr "" #. type: TP #: man-pages/man7/inotify.7:203 #, no-wrap msgid "B (*)" msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:218 msgid "" "Metadata changed\\(emfor example, permissions (e.g., B(2)), " "timestamps (e.g., B(2)), extended attributes (B(2)), " "link count (since Linux 2.6.25; e.g., for the target of B(2) and for " "B(2)), and user/group ID (e.g., B(2))." msgstr "" #. type: TP #: man-pages/man7/inotify.7:218 #, no-wrap msgid "B (*)" msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:221 msgid "File opened for writing was closed." msgstr "" #. type: TP #: man-pages/man7/inotify.7:221 #, no-wrap msgid "B (*)" msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:224 msgid "File not opened for writing was closed." msgstr "" #. type: TP #: man-pages/man7/inotify.7:224 #, no-wrap msgid "B (+)" msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:234 msgid "" "File/directory created in watched directory (e.g., B(2) B, " "B(2), B(2), B(2), B(2) on a UNIX domain socket)." "" msgstr "" #. type: TP #: man-pages/man7/inotify.7:234 #, no-wrap msgid "B (+)" msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:237 msgid "File/directory deleted from watched directory." msgstr "" #. type: TP #: man-pages/man7/inotify.7:237 #, no-wrap msgid "B" msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:248 msgid "" "Watched file/directory was itself deleted. (This event also occurs if an " "object is moved to another filesystem, since B(1) in effect copies the " "file to the other filesystem and then deletes it from the original " "filesystem.) In addition, an B event will subsequently be " "generated for the watch descriptor." msgstr "" #. type: TP #: man-pages/man7/inotify.7:248 #, no-wrap msgid "B (*)" msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:253 msgid "File was modified (e.g., B(2), B(2))." msgstr "" #. type: TP #: man-pages/man7/inotify.7:253 #, no-wrap msgid "B" msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:256 msgid "Watched file/directory was itself moved." msgstr "" #. type: TP #: man-pages/man7/inotify.7:256 #, no-wrap msgid "B (+)" msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:260 msgid "" "Generated for the directory containing the old filename when a file is " "renamed." msgstr "" #. type: TP #: man-pages/man7/inotify.7:260 #, no-wrap msgid "B (+)" msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:264 msgid "" "Generated for the directory containing the new filename when a file is " "renamed." msgstr "" #. type: TP #: man-pages/man7/inotify.7:264 #, no-wrap msgid "B (*)" msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:267 msgid "File was opened." msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:270 msgid "When monitoring a directory:" msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:273 msgid "" "the events marked above with an asterisk (*) can occur both for the " "directory itself and for objects inside the directory; and" msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:276 msgid "" "the events marked with a plus sign (+) occur only for objects inside the " "directory (not for the directory itself)." msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:282 msgid "" "When events are generated for objects inside a watched directory, the " "I field in the returned I structure identifies the name " "of the file within the directory." msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:290 msgid "" "The B macro is defined as a bit mask of all of the above " "events. This macro can be used as the I argument when calling " "B(2)." msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:292 msgid "Two additional convenience macros are defined:" msgstr "" #. type: TP #: man-pages/man7/inotify.7:293 #, no-wrap msgid "B" msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:297 msgid "Equates to B." msgstr "" #. type: TP #: man-pages/man7/inotify.7:297 #, no-wrap msgid "B" msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:301 msgid "Equates to B." msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:307 msgid "" "The following further bits can be specified in I when calling " "B(2):" msgstr "" #. type: TP #: man-pages/man7/inotify.7:308 #, no-wrap msgid "B (since Linux 2.6.15)" msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:313 msgid "Don't dereference I if it is a symbolic link." msgstr "" #. type: TP #: man-pages/man7/inotify.7:313 #, no-wrap msgid "B (since Linux 2.6.36)" msgstr "" #. commit 8c1934c8d70b22ca8333b216aec6c7d09fdbd6a6 #. type: Plain text #: man-pages/man7/inotify.7:329 msgid "" "By default, when watching events on the children of a directory, events are " "generated for children even after they have been unlinked from the directory." " This can result in large numbers of uninteresting events for some " "applications (e.g., if watching I, in which many applications create " "temporary files whose names are immediately unlinked). Specifying " "B changes the default behavior, so that events are not " "generated for children after they have been unlinked from the watched " "directory." msgstr "" #. type: TP #: man-pages/man7/inotify.7:329 #, no-wrap msgid "B" msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:336 msgid "" "If a watch instance already exists for the filesystem object corresponding " "to I, add (OR) the events in I to the watch mask (instead of " "replacing the mask)." msgstr "" #. type: TP #: man-pages/man7/inotify.7:336 #, no-wrap msgid "B" msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:342 msgid "" "Monitor the filesystem object corresponding to I for one event, " "then remove from watch list." msgstr "" #. type: TP #: man-pages/man7/inotify.7:342 #, no-wrap msgid "B (since Linux 2.6.15)" msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:347 msgid "Only watch I if it is a directory." msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:353 msgid "" "The following bits may be set in the I field returned by B(2):" msgstr "" #. type: TP #: man-pages/man7/inotify.7:354 #, no-wrap msgid "B" msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:360 msgid "" "Watch was removed explicitly (B(2)) or automatically " "(file was deleted, or filesystem was unmounted). See also BUGS." msgstr "" #. type: TP #: man-pages/man7/inotify.7:360 #, no-wrap msgid "B" msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:363 msgid "Subject of this event is a directory." msgstr "" #. type: TP #: man-pages/man7/inotify.7:363 #, no-wrap msgid "B" msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:368 msgid "Event queue overflowed (I is -1 for this event)." msgstr "" #. type: TP #: man-pages/man7/inotify.7:368 #, no-wrap msgid "B" msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:374 msgid "" "Filesystem containing watched object was unmounted. In addition, an " "B event will subsequently be generated for the watch descriptor." msgstr "" #. type: SS #: man-pages/man7/inotify.7:375 #, no-wrap msgid "Examples" msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:383 msgid "" "Suppose an application is watching the directory I and the file I for all events. The examples below show some events that will be " "generated for these two objects." msgstr "" #. type: TP #: man-pages/man7/inotify.7:384 #, no-wrap msgid "fd = open(\"dir/myfile\", O_RDWR);" msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:392 msgid "Generates B events for both I and I." msgstr "" #. type: TP #: man-pages/man7/inotify.7:392 #, no-wrap msgid "read(fd, buf, count);" msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:400 msgid "Generates B events for both I and I." msgstr "" #. type: TP #: man-pages/man7/inotify.7:400 #, no-wrap msgid "write(fd, buf, count);" msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:408 msgid "Generates B events for both I and I." msgstr "" #. type: TP #: man-pages/man7/inotify.7:408 #, no-wrap msgid "fchmod(fd, mode);" msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:416 msgid "Generates B events for both I and I." msgstr "" #. type: TP #: man-pages/man7/inotify.7:416 #, no-wrap msgid "close(fd);" msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:424 msgid "Generates B events for both I and I." msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:433 msgid "" "Suppose an application is watching the directories I and I, and " "the file I. The following examples show some events that may " "be generated." msgstr "" #. type: TP #: man-pages/man7/inotify.7:434 #, no-wrap msgid "link(\"dir1/myfile\", \"dir2/new\");" msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:444 msgid "" "Generates an B event for I and an B event for " "I." msgstr "" #. type: TP #: man-pages/man7/inotify.7:444 #, no-wrap msgid "rename(\"dir1/myfile\", \"dir2/myfile\");" msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:465 msgid "" "Generates an B event for I, an B event for " "I, and an B event for I. The B " "and B events will have the same I value." msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:479 msgid "" "Suppose that I and I are (the only) links to the same " "file, and an application is watching I, I, I, and " "I. Executing the following calls in the order given below will " "generate the following events:" msgstr "" #. type: TP #: man-pages/man7/inotify.7:480 #, no-wrap msgid "unlink(\"dir2/yy\");" msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:491 msgid "" "Generates an B event for I (because its link count changes) " "and an B event for I." msgstr "" #. type: TP #: man-pages/man7/inotify.7:491 #, no-wrap msgid "unlink(\"dir1/xx\");" msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:504 msgid "" "Generates B, B, and B events for " "I, and an B event for I." msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:511 msgid "" "Suppose an application is watching the directory I and (the empty) " "directory I. The following examples show some events that may " "be generated." msgstr "" #. type: TP #: man-pages/man7/inotify.7:512 #, no-wrap msgid "mkdir(\"dir/new\", mode);" msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:518 msgid "Generates an B event for I." msgstr "" #. type: TP #: man-pages/man7/inotify.7:518 #, no-wrap msgid "rmdir(\"dir/subdir\");" msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:530 msgid "" "Generates B and B events for I, and an " "B event for I." msgstr "" #. type: SS #: man-pages/man7/inotify.7:531 #, no-wrap msgid "/proc interfaces" msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:534 msgid "" "The following interfaces can be used to limit the amount of kernel memory " "consumed by inotify:" msgstr "" #. type: TP #: man-pages/man7/inotify.7:534 #, no-wrap msgid "I" msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:543 msgid "" "The value in this file is used when an application calls B(2) " "to set an upper limit on the number of events that can be queued to the " "corresponding inotify instance. Events in excess of this limit are dropped, " "but an B event is always generated." msgstr "" #. type: TP #: man-pages/man7/inotify.7:543 #, no-wrap msgid "I" msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:547 msgid "" "This specifies an upper limit on the number of inotify instances that can be " "created per real user ID." msgstr "" #. type: TP #: man-pages/man7/inotify.7:547 #, no-wrap msgid "I" msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:551 msgid "" "This specifies an upper limit on the number of watches that can be created " "per real user ID." msgstr "" #. type: SH #: man-pages/man7/inotify.7:551 #, no-wrap msgid "VERSIONS" msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:559 msgid "" "Inotify was merged into the 2.6.13 Linux kernel. The required library " "interfaces were added to glibc in version 2.4. (B, " "B, and B were added in glibc version 2.5.)" msgstr "" #. type: SH #: man-pages/man7/inotify.7:559 #, no-wrap msgid "CONFORMING TO" msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:561 msgid "The inotify API is Linux-specific." msgstr "" #. type: SH #: man-pages/man7/inotify.7:561 #, no-wrap msgid "NOTES" msgstr "" #. type: Plain text #: man-pages/man7/inotify.7:568 msgid "" "Inotify file descriptors can be monitored using B