GithubHelp home page GithubHelp logo

Detecting rename target about fsnotify HOT 1 CLOSED

howeyc avatar howeyc commented on August 16, 2024
Detecting rename target

from fsnotify.

Comments (1)

howeyc avatar howeyc commented on August 16, 2024

It's not that I don't want to have this functionality. I really would, but I see no way to provide it.

FreeBSD/OSX - You need to open a file descriptor to watch it. The kevent does not specify the location of the file at all.
Look at EVFILT_NODE section of man page: http://www.freebsd.org/cgi/man.cgi?query=kqueue&apropos=0&sektion=0&manpath=FreeBSD+9.0-RELEASE&arch=default&format=html

Linux - Events are received for the directory you watch, so if you are not watching the target directory, you will only get the event coming out of the directory you are watching.
Man page for reference: http://linux.die.net/man/7/inotify
Now, you can watch individual files, but as far as I know, you can't get the destination location after a rename.

Windows - I am less familiar with this one, but it appears all changes are based on the directory, not even watching individual files. So again, you need to watch the target directory.
http://msdn.microsoft.com/en-us/library/windows/desktop/aa365465(v=vs.85).aspx

I am hesitant to expose the underlying inotify event, because it makes the API less-consistent across operating systems and also because I'm not sure you'd gain the functionality you seek anyway.

Now, it may be possible that I have misread the documents, or there is some other way of doing this that I have not thought of. If I have missed something that will provide the rename functionality, please let me know. I'd be more than happy to rectify the situation.

from fsnotify.

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.