Sample code for 30+ languages & platforms
Perl Requires Chilkat v9.5.0.77+

Get the Target of a Symbolic Link

See more FileAccess Examples

Demonstrates how to get the target of a symbolic link.

Chilkat Perl Downloads

Chilkat2 Perl
use strict;
use warnings;
use Chilkat2;

my $fac = Chilkat2::FileAccess->new;

my $targetPath = $fac->SymlinkTarget('qa_data/my_symlink');
if (!$fac->LastMethodSuccess) {
    print "Failed to get symlink target.\n";
    exit;
}

print 'target path = ', $targetPath, "\n";