Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Listen could detect changes in symlinked files #280

Open
e2 opened this issue Nov 26, 2014 · 4 comments
Open

Feature request: Listen could detect changes in symlinked files #280

e2 opened this issue Nov 26, 2014 · 4 comments
Labels
✨ Feature Adds a new feature linux

Comments

@e2
Copy link
Contributor

e2 commented Nov 26, 2014

Listen follows symlinked directories to watch the original directories, though symlinked files obviously don't trigger changes on the directories they are in.

Example: if foo/file.txt is symlinked to bar/original.txt, Listen could detect this and quietly add bar as a watched dir, but report foo/file.txt as changed (and ignore any other changes in bar).

(Polling already does this, because it uses 'lstat' and relies completely on Record and scans the whole watched tree anyway at regular time intervals.)

This feature is not really needed, but it would be "proof" that the architecture of Listen is sound and that it "meets user expectations" (however technically unrealistic or self-conflicting they usually are).

@akerbos
Copy link

akerbos commented Nov 27, 2014

This feature is not really needed

I respectfully disagree and am glad that you consider implementing this!

@e2 e2 added the linux label Nov 27, 2014
@e2
Copy link
Contributor Author

e2 commented Nov 27, 2014

I believe this is a Linux-only feature. Polling scans everything, and OSX support is basically the same, except it scans less directories and when actual (but unknown) events occur.

This is a problem, because Listen is almost pointless on Linux, where lots of directories can be cheaply and effectively scanned. Listen is just pure overhead on Linux, while every bit of Listen is essential for the other adapters.

I don't use OSX or Windows, and implementing anything "smart" in Listen means potentially breaking those platforms.

"Adding" something while not breaking something is the biggest challenge in Listen.

So I'll consider implementing this sooner rather than later - and just for Linux (as a "if Linux/inotify" thing).

@akerbos
Copy link

akerbos commented Nov 27, 2014

If Listen is "pure overhead" on Linux, what do you recommend? rb-inotify directly or something different?

@e2
Copy link
Contributor Author

e2 commented Nov 27, 2014

It depends on what you need and if you're using Listen directly or not. "Pure overhead" maybe isn't fair.

Here are the "bonuses" of using Listen under Linux:

  • it's used by other apps (Sass, Vagrant, Guard, Spring, etc.), and the overhead is acceptable, given portability. (You can run with LISTEN_GEM_DEBUGGING=2 to see if you're actually paying a price for this overhead or not.
  • smart editor support (translating move_to, and move_from into changes)
  • built in ignore rules

and most importantly - waiting for activity to "stop" and then merging chunks of changes into single events (important for editing) - instead of getting the callback immediately called whenever "anything" changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Feature Adds a new feature linux
Projects
None yet
Development

No branches or pull requests

2 participants