For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > August 2005 > Using File::Find to follow symlinks









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Using File::Find to follow symlinks
Adam Rosi-Kessel

2005-08-04, 5:01 pm

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

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com