Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

readlink

Returns the target of a symbolic link.

Returns the filename pointed to by the symbolic link EXPR, or $_ if omitted. Returns undef on error (e.g., not a symlink, file not found) and sets $!. Uses std::fs::read_link and converts the result to a string via to_string_lossy.

Synopsis

my $target = readlink $symlink;
my $target = readlink '/usr/bin/perl';
my $target = readlink;     # readlink($_)

See Also

symlink, lstat, stat