On Wed, Feb 14, 2001 at 04:07:34PM +0000, David Cantrell wrote:
> Sorry for not talking about beer or buffy, but I'm stuck and need help.
> 
> How can I easily tell whether a directory entry is a symlink to a symlink?
> -l will tell we whether it's a symlink, but I can't see any way of telling
> what it points to - and more importantly, what it is that it points to.

If it's a symlink you should be able to readlink it (see perlfunc) to get
the thing that it points at
(although you'll have to do some file concatenation logic based on whether
it's absolute or relative)
And then you can test that (and work your way along the symlink chain,
but make sure you put a trap in after a some large number of steps else
you will be gotcha'd by symlinks looping back to themselves)

Nicholas Clark

Reply via email to