From: Robert Klemme Date: 2007-02-16T18:20:09+09:00 Subject: Re: Found a Find.find() bug? On 15.02.2007 23:25, robertlaferla@comcast.net wrote: > Sorry, there was a typo in my e-mail. One should be "/tmp" and the other should be "/tmp/" > And yes, I am using this on Mac OS X where /tmp is a symlink to /private/tmp. > Should Ruby care about symlinks? IMHO, it should work whether or not it is a symlink or not. That's not Ruby's fault - it's the way filesystems work on Unix. Moral, if your directory can be a symlink you should use Find.find("/tmp/."). Note that there are good reasons to not follow symlinks by default. But having similar options find's option "-follow" and friends might make up a good feature request for Find. Alternatively we could have another method added, kind of complementary to prune which will add the current file to the processing chain. # sample Find.find "/foo/bar" do |file| puts file # no effect if not a symlink, # but if a symlink to a dir # descend that dir now Find.follow end What do others think? Kind regards robert