Comments (5)
- I found out that Windows can report a ERROR_NOTIFY_ENUM_DIR error when it's buffer overflows. Unfortunately this doesn't seem to work with asynchronous usage of ReadDirectoryChangesW.
- I haven't done any testing on the infinite loop in Windows, yet.
For the "rename self file" event on windows, could we get the path the file was renamed to, stop watching the old one, and start watching this new one, to align with linux?
- That's seems like the best way to do it. Unfortunately this is very tricky to implement. The data structure that currently holds the path of the watched file gets cloned every time the start_read function is called, somehow this path needs to be overwritten though. So we would need some kind of shared memory or something.
- I haven't looked at the polling behavior, yet.
from notify.
- Agree with removing ignore.
- I'll have a look at other libraries to see how they handle these, for comparison.
- For renames, would it be possible to aggregate events so we provide a single event that describes the rename entirely, without needing cookies? Or would that be too hard/impossible?
- agree with osx chmod
- tentatively agree with the rest, but pending comparison to other libraries and review when I'm properly awake
from notify.
For renames, would it be possible to aggregate events so we provide a single event that describes the rename entirely, without needing cookies?
It would be possible and it was actually my first approach, but I ran into some troubles. This was before I wanted to change move_out events to delete though. So at this point I'm not sure what the better option would be. Either way handling renames on OS X will be a mess.
from notify.
After a survey of other libraries (Go's fsnotify and notify, Ruby's listen, Facebook's Watchman daemon, Node's chokidar):
- The "consensus" seems to be that rename handling is hard. Some libraries just give up and delegate to the user. Some don't bother and just provide a "change" event. We should do the best we can, but not worry too much if that's not perfect.
- So: let's go with best-effort cookies as a first pass, then see afterwards, as an optional bonus, if it is feasible to have a sane "cookie-less" aggregated event. It looks fairly impossible on OS X.
- As far as I can tell, nobody emits ignore, nor overflow. Ignore being inotify only, let's remove it, but overflow is an important hint, so let's add it. I think the notify vision might be to (in the future) mitigate automagically in case of MUST_SCAN_SUBDIRS, for example.
- Nobody emits chmod events, but as it's fairly well supported, we can.
- What can we do about the infinite loop in Windows? Can we detect that, send a final remove event, and close up?
- For the "rename self file" event on windows, could we get the path the file was renamed to, stop watching the old one, and start watching this new one, to align with linux? Or should we do the reverse, and, on linux, when we get an IN_MOVE_SELF on a file, stop watching the inode and add a watch on the original path?
- As point of interest, how does the polling behaviour compare, when available, on those events?
If not mentioned or addressed, I agree with you on the rest.
from notify.
This has been released in 3.0.0! Finally got it all done and released and going.
from notify.
Related Issues (20)
- My program stops getting events after some time HOT 2
- Watch code is not run inside helper function HOT 2
- `notify-debouncer-full` / `-mini` always enable `notify` default features
- Proposal: Change the serialization format of events HOT 2
- Inconsistent behaviors when root node changes HOT 3
- inotify backend: MOVE_SELF event keeps watch and reports incorrect path HOT 1
- Prepare notify 7.0 release HOT 2
- Zbus / Nix Dependency Issue HOT 2
- Feature request: unwatch subpaths
- Receiving `Modify(Metadata(Any))` only if file contents becomes empty from non-empty HOT 2
- Full CPU core usage with the Inotify backend HOT 1
- Not adequate README/links to documentation on crates.io for file-id
- inotify: files pointed at by multiples symlinks generate events only for one path HOT 1
- Relax windows-rs version requirement
- Simple example from documentation doesn't work
- On FreeBSD notifications are only delivered using `RecursiveMode::Recursive`
- TOCTOU bug when adding a watcher HOT 1
- Watch on non-existing file HOT 3
- PollWatcher: Ignore IO "file not found" exceptions when accessing entry metadata?🥺 HOT 2
- .
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from notify.