|
|
|
|
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `inotify_sys` crate."><meta name="keywords" content="rust, rustlang, rust-lang, inotify_sys"><title>inotify_sys - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../dark.css"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="shortcut icon" href="../favicon.ico"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../inotify_sys/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Crate inotify_sys</p><div class="sidebar-elems"><a id='all-types' href='all.html'><p>See all inotify_sys's items</p></a><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#constants">Constants</a></li><li><a href="#functions">Functions</a></li></ul></div><p class='location'></p><script>window.sidebarCurrent = {name: 'inotify_sys', ty: 'mod', relpath: '../'};</script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form js-only"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../src/inotify_sys/lib.rs.html#1-713' title='goto source code'>[src]</a></span><span class='in-band'>Crate <a class="mod" href=''>inotify_sys</a></span></h1><div class='docblock'><h1 id="inotify-bindings-for-the-rust-programming-language" class="section-header"><a href="#inotify-bindings-for-the-rust-programming-language">inotify bindings for the Rust programming language</a></h1>
|
|
|
|
|
<p>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,
|
|
|
|
|
<a href="https://crates.io/crates/inotify">inotify-rs</a>, which is an idiomatic wrapper, is a much better choice.</p>
|
|
|
|
|
<h2 id="usage" class="section-header"><a href="#usage">Usage</a></h2>
|
|
|
|
|
<p>In general, inotify usage follows the following pattern:</p>
|
|
|
|
|
<ol>
|
|
|
|
|
<li>Create an inotify instance using <a href="fn.inotify_init.html"><code>inotify_init</code></a> or <a href="fn.inotify_init1.html"><code>inotify_init1</code></a>.</li>
|
|
|
|
|
<li>Manage watches with <a href="fn.inotify_add_watch.html"><code>inotify_add_watch</code></a> and <a href="fn.inotify_rm_watch.html"><code>inotify_rm_watch</code></a>.</li>
|
|
|
|
|
<li>Read event using <a href="fn.read.html"><code>read</code></a>.</li>
|
|
|
|
|
<li>Close the inotify instance using <a href="fn.close.html"><code>close</code></a>, once you're done.</li>
|
|
|
|
|
</ol>
|
|
|
|
|
<p>Please refer to the <a href="http://man7.org/linux/man-pages/man7/inotify.7.html">inotify man page</a> and the rest of this documentation
|
|
|
|
|
for full details.</p>
|
|
|
|
|
</div><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
|
|
|
|
|
<table><tr class='module-item'><td><a class="struct" href="struct.inotify_event.html" title='inotify_sys::inotify_event struct'>inotify_event</a></td><td class='docblock-short'><p>Describes a file system event</p>
|
|
|
|
|
</td></tr></table><h2 id='constants' class='section-header'><a href="#constants">Constants</a></h2>
|
|
|
|
|
<table><tr class='module-item'><td><a class="constant" href="constant.IN_ACCESS.html" title='inotify_sys::IN_ACCESS constant'>IN_ACCESS</a></td><td class='docblock-short'><p>Event: File was accessed</p>
|
|
|
|
|
</td></tr><tr class='module-item'><td><a class="constant" href="constant.IN_ALL_EVENTS.html" title='inotify_sys::IN_ALL_EVENTS constant'>IN_ALL_EVENTS</a></td><td class='docblock-short'><p>Event: Any event occured</p>
|
|
|
|
|
</td></tr><tr class='module-item'><td><a class="constant" href="constant.IN_ATTRIB.html" title='inotify_sys::IN_ATTRIB constant'>IN_ATTRIB</a></td><td class='docblock-short'><p>Event: Metadata was changed</p>
|
|
|
|
|
</td></tr><tr class='module-item'><td><a class="constant" href="constant.IN_CLOEXEC.html" title='inotify_sys::IN_CLOEXEC constant'>IN_CLOEXEC</a></td><td class='docblock-short'><p>Set the <code>FD_CLOEXEC</code> flag for an inotify instance</p>
|
|
|
|
|
</td></tr><tr class='module-item'><td><a class="constant" href="constant.IN_CLOSE.html" title='inotify_sys::IN_CLOSE constant'>IN_CLOSE</a></td><td class='docblock-short'><p>Event: File was closed</p>
|
|
|
|
|
</td></tr><tr class='module-item'><td><a class="constant" href="constant.IN_CLOSE_NOWRITE.html" title='inotify_sys::IN_CLOSE_NOWRITE constant'>IN_CLOSE_NOWRITE</a></td><td class='docblock-short'><p>Event: Non-writable file or directory was closed</p>
|
|
|
|
|
</td></tr><tr class='module-item'><td><a class="constant" href="constant.IN_CLOSE_WRITE.html" title='inotify_sys::IN_CLOSE_WRITE constant'>IN_CLOSE_WRITE</a></td><td class='docblock-short'><p>Event: Writable file was closed</p>
|
|
|
|
|
</td></tr><tr class='module-item'><td><a class="constant" href="constant.IN_CREATE.html" title='inotify_sys::IN_CREATE constant'>IN_CREATE</a></td><td class='docblock-short'><p>Event: File or directory was created in watched directory</p>
|
|
|
|
|
</td></tr><tr class='module-item'><td><a class="constant" href="constant.IN_DELETE.html" title='inotify_sys::IN_DELETE constant'>IN_DELETE</a></td><td class='docblock-short'><p>Event: File or directory in watched directory was deleted</p>
|
|
|
|
|
</td></tr><tr class='module-item'><td><a class="constant" href="constant.IN_DELETE_SELF.html" title='inotify_sys::IN_DELETE_SELF constant'>IN_DELETE_SELF</a></td><td class='docblock-short'><p>Event: Watched file or directory was deleted</p>
|
|
|
|
|
</td></tr><tr class='module-item'><td><a class="constant" href="constant.IN_DONT_FOLLOW.html" title='inotify_sys::IN_DONT_FOLLOW constant'>IN_DONT_FOLLOW</a></td><td class='docblock-short'><p>Don't dereference path, if it is a symbolic link</p>
|
|
|
|
|
</td></tr><tr class='module-item'><td><a class="constant" href="constant.IN_EXCL_UNLINK.html" title='inotify_sys::IN_EXCL_UNLINK constant'>IN_EXCL_UNLINK</a></td><td class='docblock-short'><p>Ignore events for children, that have been unlinked from watched directory</p>
|
|
|
|
|
</td></tr><tr class='module-item'><td><a class="constant" href="constant.IN_IGNORED.html" title='inotify_sys::IN_IGNORED constant'>IN_IGNORED</a></td><td class='docblock-short'><p>Indicates that a file system watch was removed</p>
|
|
|
|
|
</td></tr><tr class='module-item'><td><a class="constant" href="constant.IN_ISDIR.html" title='inotify_sys::IN_ISDIR constant'>IN_ISDIR</a></td><td class='docblock-short'><p>Indicates that the subject of an event is a directory</p>
|
|
|
|
|
</td></tr><tr class='module-item'><td><a class="constant" href="constant.IN_MASK_ADD.html" title='inotify_sys::IN_MASK_ADD constant'>IN_MASK_ADD</a></td><td class='docblock-short'><p>Update existing watch mask, instead of replacing it</p>
|
|
|
|
|
</td></tr><tr class='module-item'><td><a class="constant" href="constant.IN_MODIFY.html" title='inotify_sys::IN_MODIFY constant'>IN_MODIFY</a></td><td class='docblock-short'><p>Event: File was modified</p>
|
|
|
|
|
</td></tr><tr class='module-item'><td><a class="constant" href="constant.IN_MOVE.html" title='inotify_sys::IN_MOVE constant'>IN_MOVE</a></td><td class='docblock-short'><p>Event: File or directory within watched directory was moved</p>
|
|
|
|
|
</td></tr><tr class='module-item'><td><a class="constant" href="constant.IN_MOVED_FROM.html" title='inotify_sys::IN_MOVED_FROM constant'>IN_MOVED_FROM</a></td><td class='docblock-short'><p>Event: File or directory was moved out of watched directory</p>
|
|
|
|
|
</td></tr><tr class='module-item'><td><a class="constant" href="constant.IN_MOVED_TO.html" title='inotify_sys::IN_MOVED_TO constant'>IN_MOVED_TO</a></td><td class='docblock-short'><p>Event: File or directory was moved into watched directory</p>
|
|
|
|
|
</td></tr><tr class='module-item'><td><a class="constant" href="constant.IN_MOVE_SELF.html" title='inotify_sys::IN_MOVE_SELF constant'>IN_MOVE_SELF</a></td><td class='docblock-short'><p>Event: Watched file or directory was moved</p>
|
|
|
|
|
</td></tr><tr class='module-item'><td><a class="constant" href="constant.IN_NONBLOCK.html" title='inotify_sys::IN_NONBLOCK constant'>IN_NONBLOCK</a></td><td class='docblock-short'><p>Set an inotify instance to non-blocking mode</p>
|
|
|
|
|
</td></tr><tr class='module-item'><td><a class="constant" href="constant.IN_ONESHOT.html" title='inotify_sys::IN_ONESHOT constant'>IN_ONESHOT</a></td><td class='docblock-short'><p>Remove watch after one event</p>
|
|
|
|
|
</td></tr><tr class='module-item'><td><a class="constant" href="constant.IN_ONLYDIR.html" title='inotify_sys::IN_ONLYDIR constant'>IN_ONLYDIR</a></td><td class='docblock-short'><p>Only watch path, if it is a directory</p>
|
|
|
|
|
</td></tr><tr class='module-item'><td><a class="constant" href="constant.IN_OPEN.html" title='inotify_sys::IN_OPEN constant'>IN_OPEN</a></td><td class='docblock-short'><p>Event: File or directory was opened</p>
|
|
|
|
|
</td></tr><tr class='module-item'><td><a class="constant" href="constant.IN_Q_OVERFLOW.html" title='inotify_sys::IN_Q_OVERFLOW constant'>IN_Q_OVERFLOW</a></td><td class='docblock-short'><p>Indicates that the event queue has overflowed</p>
|
|
|
|
|
</td></tr><tr class='module-item'><td><a class="constant" href="constant.IN_UNMOUNT.html" title='inotify_sys::IN_UNMOUNT constant'>IN_UNMOUNT</a></td><td class='docblock-short'><p>Indicates that file system containing a watched object has been unmounted</p>
|
|
|
|
|
</td></tr></table><h2 id='functions' class='section-header'><a href="#functions">Functions</a></h2>
|
|
|
|
|
<table><tr class='module-item'><td><a class="fn" href="fn.close.html" title='inotify_sys::close fn'>close</a><a title='unsafe function' href='#'><sup>⚠</sup></a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="fn" href="fn.inotify_add_watch.html" title='inotify_sys::inotify_add_watch fn'>inotify_add_watch</a><a title='unsafe function' href='#'><sup>⚠</sup></a></td><td class='docblock-short'><p>Adds or updates an inotify watch</p>
|
|
|
|
|
</td></tr><tr class='module-item'><td><a class="fn" href="fn.inotify_init.html" title='inotify_sys::inotify_init fn'>inotify_init</a><a title='unsafe function' href='#'><sup>⚠</sup></a></td><td class='docblock-short'><p>Creates an inotify instance</p>
|
|
|
|
|
</td></tr><tr class='module-item'><td><a class="fn" href="fn.inotify_init1.html" title='inotify_sys::inotify_init1 fn'>inotify_init1</a><a title='unsafe function' href='#'><sup>⚠</sup></a></td><td class='docblock-short'><p>Creates an inotify instance</p>
|
|
|
|
|
</td></tr><tr class='module-item'><td><a class="fn" href="fn.inotify_rm_watch.html" title='inotify_sys::inotify_rm_watch fn'>inotify_rm_watch</a><a title='unsafe function' href='#'><sup>⚠</sup></a></td><td class='docblock-short'><p>Removes an inotify watch</p>
|
|
|
|
|
</td></tr><tr class='module-item'><td><a class="fn" href="fn.read.html" title='inotify_sys::read fn'>read</a><a title='unsafe function' href='#'><sup>⚠</sup></a></td><td class='docblock-short'></td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><aside id="help" class="hidden"><div><h1 class="hidden">Help</h1><div class="shortcuts"><h2>Keyboard Shortcuts</h2><dl><dt><kbd>?</kbd></dt><dd>Show this help dialog</dd><dt><kbd>S</kbd></dt><dd>Focus the search field</dd><dt><kbd>↑</kbd></dt><dd>Move up in search results</dd><dt><kbd>↓</kbd></dt><dd>Move down in search results</dd><dt><kbd>↹</kbd></dt><dd>Switch tab</dd><dt><kbd>⏎</kbd></dt><dd>Go to active search result</dd><dt><kbd>+</kbd></dt><dd>Expand all sections</dd><dt><kbd>-</kbd></dt><dd>Collapse all sections</dd></dl></div><div class="infos"><h2>Search Tricks</h2><p>Prefix searches with a type followed by a colon (e.g., <code>fn:</code>) to restrict the search to a given type.</p><p>Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>.</p><p>Search functions by type signature (e.g., <code>vec -> usize</code> or <code>* -> vec</code>)</p><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../";window.currentCrate = "inotify_sys";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
|