develooper Front page | perl.beginners | Postings from August 2005

Using File::Find to follow symlinks

Adam Rosi-Kessel
August 4, 2005 10:12
Using File::Find to follow symlinks
Message ID:
I'd like to use File::Find, or some alternative, to follow symlinks;
regardless of whether the file/directory has already been traversed in
some other location. In other words, if there I have directories x and
y, and the file a is in x and symlinked into y, I want the find &wanted
function to be called on file a in both x and y.

Possible? Do I have to write my own find function from scratch? None of
the follow-find=> options seem to accomplish what I want.

I've also noticed that the &wanted function is not called even *once* in
some cases where there are duplicate symlink files (i.e., it is not even
called on the "real" file). Switching from find to finddepth seems to
fix this, but I really don't understand what's going on. Any pointers?
Adam Rosi-Kessel Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About