Struct inotify::ffi::inotify_event
[−]
[src]
#[repr(C)]pub struct inotify_event { pub wd: c_int, pub mask: uint32_t, pub cookie: uint32_t, pub len: uint32_t, }
Describes an event.
To determine what events have occurred, an application read(2)s from the inotify file descriptor. If no events have so far occurred, then, assuming a blocking file descriptor, read(2) will block until at least one event occurs (unless interrupted by a signal, in which case the call fails with the error EINTR; see signal(7)).
Each successful read(2) returns a buffer containing one or more of this structure.
Fields
wd: c_int
Identifies the watch for which this event occurs.
It is one of the watch descriptors returned by a previous call
to inotify_add_watch()
.
mask: uint32_t
Contains bits that describe the event that occurred.
A unique integer that connects related events.
Currently used only for rename events. A related pair of IN_MOVED_FROM and IN_MOVED_TO events will have the same, non-zero, cookie. For all other events, cookie is 0.
len: uint32_t
The length of name
.
Used to determine the size of this structure. When name
isn't present (name
is only present when an event occurs
for a file inside a watched directory), it is 0. When name
is present, it counts all of name
's bytes, including \0
.
The
name
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 ('\0') to align subsequent reads to a suitable address boundary.
The name
field must be ommited in this definition.
Trait Implementations
impl Clone for inotify_event
[src]
fn clone(&self) -> inotify_event
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more