|
File::Spec::Link - Perl extension for reading and resolving symbolic links |
File::Spec::Link - Perl extension for reading and resolving symbolic links
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);
my $realname = File::Spec::Link->full_resolve($file);
my $realname = File::Spec::Link->resolve_path($file);
my $realname = File::Spec::Link->resolve_all($file);
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)$link: by readlinking $link,
and resolving that path relative to the directory of $link.
resolve($link)$link, by repeatedly
calling linked. Returns undef if the link can not be resolved.
chopfile($file)$file, by splitting the path of $file
and returning (the volumne and) directory parts.
relative_to_file($path, $file)$path relative to the directory of file
$file. If $path is absolute, just returns $path.
resolve_all($file)$file with all links in the path resolved,
wihout using Cwd.
full_resolve($file)$file with all links in the path resolved.
This sub tries to use Cwd::abs_path via ->resolve_path.
resolve_path($file)$file with all links in the path resolved.
This sub uses Cwd::abs_path and is independent of the rest of
File::Spec::Link.
=head2 Object methods
new([$path])pathcanonicalvoldirdirs=item C<< pop >>
remove last component of the path
push($file)add($file)updir as pop,
and ignoring curdir and empty strings
split($path)chop=item C<< relative($path) >>
replace the path object with the supplied path, where the new path is relative to the path object
followresolved=item C<< resolvedir >>
resolve the links at all component levels within the path object
canonpath($path)catdir(@dirs)curdir from empty list
splitlast($path)$path (using chop)
and returns remaining path and compenent, as strings.
[Not used]
None - all subs are methods for File::Spec::Link.
File::Spec(3) File::Copy::Link(3)
Robin Barker, <Robin.Barker@npl.co.uk>
Copyright 2003, 2005, 2006 by Robin Barker
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
|
File::Spec::Link - Perl extension for reading and resolving symbolic links |