Expand description
§inotify bindings for the Rust programming language
Please note that these are direct, low-level bindings to C functions that form the inotify C API. Unless you have a specific reason to use this crate, inotify-rs, which is an idiomatic wrapper, is a much better choice.
§Usage
In general, inotify usage follows the following pattern:
- Create an inotify instance using
inotify_init
orinotify_init1
. - Manage watches with
inotify_add_watch
andinotify_rm_watch
. - Read event using
read
. - Close the inotify instance using
close
, once you’re done.
Please refer to the inotify man page and the rest of this documentation for full details.
Structs§
- inotify_
event - Describes a file system event
Constants§
- IN_
ACCESS - Event: File was accessed
- IN_
ALL_ EVENTS - Event: Any event occured
- IN_
ATTRIB - Event: Metadata was changed
- IN_
CLOEXEC - Set the
FD_CLOEXEC
flag for an inotify instance - IN_
CLOSE - Event: File was closed
- IN_
CLOSE_ NOWRITE - Event: Non-writable file or directory was closed
- IN_
CLOSE_ WRITE - Event: Writable file was closed
- IN_
CREATE - Event: File or directory was created in watched directory
- IN_
DELETE - Event: File or directory in watched directory was deleted
- IN_
DELETE_ SELF - Event: Watched file or directory was deleted
- IN_
DONT_ FOLLOW - Don’t dereference path, if it is a symbolic link
- IN_
EXCL_ UNLINK - Ignore events for children, that have been unlinked from watched directory
- IN_
IGNORED - Indicates that a file system watch was removed
- IN_
ISDIR - Indicates that the subject of an event is a directory
- IN_
MASK_ ADD - Update existing watch mask, instead of replacing it
- IN_
MODIFY - Event: File was modified
- IN_MOVE
- Event: File or directory within watched directory was moved
- IN_
MOVED_ FROM - Event: File or directory was moved out of watched directory
- IN_
MOVED_ TO - Event: File or directory was moved into watched directory
- IN_
MOVE_ SELF - Event: Watched file or directory was moved
- IN_
NONBLOCK - Set an inotify instance to non-blocking mode
- IN_
ONESHOT - Remove watch after one event
- IN_
ONLYDIR - Only watch path, if it is a directory
- IN_OPEN
- Event: File or directory was opened
- IN_
Q_ OVERFLOW - Indicates that the event queue has overflowed
- IN_
UNMOUNT - Indicates that file system containing a watched object has been unmounted
Functions§
- close⚠
- inotify_
add_ ⚠watch - Adds or updates an inotify watch
- inotify_
init ⚠ - Creates an inotify instance
- inotify_
init1 ⚠ - Creates an inotify instance
- inotify_
rm_ ⚠watch - Removes an inotify watch
- read⚠