inotify-rs | Idiomatic inotify wrapper for the Rust programming language | DevOps library
kandi X-RAY | inotify-rs Summary
kandi X-RAY | inotify-rs Summary
Idiomatic inotify wrapper for the Rust programming language
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of inotify-rs
inotify-rs Key Features
inotify-rs Examples and Code Snippets
Community Discussions
Trending Discussions on inotify-rs
QUESTION
I'm using Inotify (through the inotify-rs wrapper) to watch a large number of files (not directories) across a filesystem.
The following inotify-rs method returns a WatchDescriptor
struct:
ANSWER
Answered 2017-Jul-26 at 17:21There are some substantial issues with this library:
- The poor choice of type to represent the inotify watch descriptor. Inotify watch descriptors are not Unix file descriptors, they are just some integral number, scoped per inotify file descriptor. Not a flaw by itself, but I certainly would view that as a red flag.
- As noted above, inotify watch descriptor values are scoped per parent inotify file descriptor. This makes the use of
[derive(Eq)]
onWatchDescriptor
highly questionable. Looks like a straight-up bug. - There is nothing to ensure that inotify watches are closed before closing the inotify descriptor. There is nothing to ensure that watch descriptors don't get reused behind your back (they can be reused after watch descriptor number wraps). Those issues probably won't bite you immediately, but… IMO, the entire inotify-rs should have been declared
unsafe
. It does not add any actual safety on top of inotify, just some sugar and pointless wrappers. It does not even implementDrop
for the watch descriptor! - The library does nothing to highlight major gotchas of inotify: event queue overflows,
IN_IGNORED
and hard links sharing the same inode (and the same inotify watch descriptors!)
I recommend you to carefully read the inotify documentation and write your own wrapper if necessary. This library won't save you any trouble.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install inotify-rs
Rust is installed and managed by the rustup tool. Rust has a 6-week rapid release process and supports a great number of platforms, so there are many builds of Rust available at any time. Please refer rust-lang.org for more information.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page