Struct inotify_sys::inotify_event[][src]

#[repr(C)]
pub struct inotify_event { pub wd: c_int, pub mask: u32, pub cookie: u32, pub len: u32, }
Expand description

Describes a file system event

From inotify(7):

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

This is one of the watch descriptors returned by a previous call to inotify_add_watch().

mask: u32

Describes the type file system event

One of the following bits will be set, to identify the type of event:

Some constants cover multiple bits, and can be used for a less precise check of the event type:

In addition, the IN_ISDIR bit can be set.

cookie: u32

A number 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: u32

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 has been ommited in this struct’s definition.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.