in reply to Symbolic Links

You want to investigate the readlink function.

 my $dir = readlink( '/some/directory' );

If you have symbolic links pointing to other symbolic links you will have to walk down the chain:

while( -l $dir ) { $dir = readlink $dir }

or more concise:

  1 while( -l $dir and $dir=readlink($dir))


g r i n d e r

Replies are listed 'Best First'.
Re: Re: Symbolic Links
by merlyn (Sage) on Aug 03, 2001 at 02:28 UTC