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

Using File::Find to follow symlinks

From:
Adam Rosi-Kessel
Date:
August 4, 2005 10:12
Subject:
Using File::Find to follow symlinks
Message ID:
42F232B6.4080102@rosi-kessel.org
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
http://adam.rosi-kessel.org



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About