NAME
File::Spec::Link - Perl extension for reading and resolving symbolic links
SYNOPSIS
use File::Spec::Link;
my $file = File::Spec::Link->linked($link);
my $file = File::Spec::Link->resolve($link);
my $dirname = File::Spec::Link->chopfile($file);
my $newname = File::Spec::Link->relative_to_file($path, $link);
DESCRIPTION
File::Spec::Link is an extension to File::Spec, adding methods for resolving symbolic links; it was created to implement File::Copy::Link.
->linked($link)-
Returns the filename linked to by <$link>: by
readlinking$link, and resolving that path relative to the directory of$link. ->resolve($link)-
Returns the non-link ultimately linked to by <$link>, by repeatedly calling
linked. Returnsundefif the link can not be resolved. ->chopfile($file)-
Returns the directory of
$file, by splitting the path of$fileand returning (the volumne and) directory parts. ->relative_to_file($path, $file)-
Returns the path of
$pathrelative to the directory of file$file. If$pathis absolute, just returns$path.
EXPORT
None - all subs are class methods for File::Spec::Link.
SEE ALSO
File::Spec(3) File::Copy::Link(3)
AUTHOR
Robin Barker, <Robin.Barker@npl.co.uk>
COPYRIGHT AND LICENSE
Copyright 2003 by Robin Barker
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.