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

symlink resolution broken with fsevents #12

Closed
nemurimasu opened this issue Aug 19, 2010 · 1 comment
Closed

symlink resolution broken with fsevents #12

nemurimasu opened this issue Aug 19, 2010 · 1 comment
Labels

Comments

@nemurimasu
Copy link

I ran into this while trying to watch a subdirectory of /var on Mac OS X where /var is a link to private/var.

Run testa.rb and then testb.rb(without stopping testa) and you'll get a bunch of paths printed out that don't actually exist on the filesystem.

testa.rb:
require 'rubygems'
require 'fssm'
require 'tmpdir'

FSSM.monitor do
  path Dir.tmpdir do
    create do |base, relative|
      p "#{base}/#{relative}"
    end
    update do |base, relative|
      p "#{base}/#{relative}"
    end
    delete do |base, relative|
      p "#{base}/#{relative}"
    end
  end
end

testb.rb:
require 'tmpdir'

path = "#{Dir.tmpdir}/fssmsymlinktest"
File.open(path, 'w') do |w|
  w.write("fssm is about to output a bad path")
end
sleep 2
File.delete(path)
@ttilley
Copy link
Owner

ttilley commented Jan 26, 2011

the issue exists in both the rubycocoa fsevent backend and rb-fsevent, so it looks like resolving full paths is just something that fsevent does for you if you want it to or not. to work around this i'm resolving the path you pass in to monitor.path so that the structure in the cache matches what fsevent will eventually give to you, but i'm wondering if there will be further issues with symlinks under the path you initially watch as well. fun times.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants