Code Monkey home page Code Monkey logo

Comments (5)

dfaust avatar dfaust commented on May 19, 2024 1
  • 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.

passcod avatar passcod commented on May 19, 2024
  • 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.

dfaust avatar dfaust commented on May 19, 2024

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.

passcod avatar passcod commented on May 19, 2024

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.

passcod avatar passcod commented on May 19, 2024

This has been released in 3.0.0! Finally got it all done and released and going.

from notify.

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.