Giter Site home page Giter Site logo

Comments (4)

hannobraun avatar hannobraun commented on August 16, 2024

Before I answer, first a clarification: inotify-rs is just a wrapper around Linux's inotify API, and it doesn't really do a whole lot on top of that. Therefore what you describe is not a behavior of inotify-rs, but of inotify itself.

I can't speak to the intended usage, but I think it's unnecessary to create one Inotify instance per directory. You should be able to distinguish the events using the WatchDescriptor returned by the add_watch method. Event's field wd is a WatchDescriptor too, so you can use that to keep track of the various watches you added.

I'm going to close this issue, as I've answered the question. Feel free to post more comments though, if you have more questions, and feel free to reopen the issue if you believe there's something in inotify-rs that needs to be changed.

from inotify-rs.

arsalan86 avatar arsalan86 commented on August 16, 2024

I'd like to add that there are known bugs in the version on crates.io (0.4.1), that have been fixed but not published. One of the bugs (see #60) is specific to WatchDescriptor and can potentially break your application. I suggest linking the dependency to the repository in your cargo.toml like so:

inotify = { git = "https://github.com/hannobraun/inotify-rs.git", branch = "master" }

The master branch has breaking changes, and some of the documentation needs to be updated to reflect that. Be aware that there are still bugs that need fixing.

Reading the Inotify man pages will be of great help. Inotify has it's quirks and it only helps to be aware of them when implementing the library.

from inotify-rs.

George3d6 avatar George3d6 commented on August 16, 2024

Thank you for the answers, I ended up going with the notify wrapper over this since it seems to implement all the functionality I need in a (hopefully reasonably fast) way.

I will however use the github rolling release style dependency with that one, since it probably uses 0.4.1 itself.

from inotify-rs.

hannobraun avatar hannobraun commented on August 16, 2024

I think notify is the right choice for most uses cases. It's a bit behind with its depdency on inotify-rs though, it still depends on 0.3.0.

from inotify-rs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.