2

Does anyone know of a Dir.glob pattern that will follow windows shortcuts (*.lnk) instead of just interpreting them as files? I would like to have a directory watcher follow shortcuts on a NTFS drive. I'm looking for something like

glob: **/*.lnk/**/*

but working ;-).

I'm aware of Can I traverse symlinked directories in Ruby with a "**" glob? and was able to do it with symlinks on unix file system, but this does not seem to have an effect in my setting with windows links (nor does it work with OSX aliases, it seems).

2
  • I doubt that one exists. The glob will have to enumerate all the *.lnk files, open them individually to extract the target of the shortcut and then do a watch on that. It gets worse when someone creates a .lnk file; the watcher will have to see this creation, open/retrieve and start a new watch on the target.
    – MJZ
    Aug 3, 2013 at 22:10
  • There's also the issue of how shell references use ObjectID to locate the target when the user moves it.
    – MJZ
    Aug 3, 2013 at 22:11

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.