.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "File::Spec::Link 3pm" .TH File::Spec::Link 3pm "2021-01-03" "perl v5.32.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" File::Spec::Link \- Perl extension for reading and resolving symbolic links .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 5 \& 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); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" \&\f(CW\*(C`File::Spec::Link\*(C'\fR is an extension to \f(CW\*(C`File::Spec\*(C'\fR, adding methods for resolving symbolic links; it was created to implement \f(CW\*(C`File::Copy::Link\*(C'\fR. .ie n .IP """linked($link)""" 4 .el .IP "\f(CWlinked($link)\fR" 4 .IX Item "linked($link)" Returns the filename linked to by \f(CW$link\fR: by \f(CW\*(C`readlink\*(C'\fRing \f(CW$link\fR, and resolving that path relative to the directory of \f(CW$link\fR. .ie n .IP """resolve($link)""" 4 .el .IP "\f(CWresolve($link)\fR" 4 .IX Item "resolve($link)" Returns the non-link ultimately linked to by \f(CW$link\fR, by repeatedly calling \f(CW\*(C`linked\*(C'\fR. Returns \f(CW\*(C`undef\*(C'\fR if the link can not be resolved. .ie n .IP """chopfile($file)""" 4 .el .IP "\f(CWchopfile($file)\fR" 4 .IX Item "chopfile($file)" Returns the directory of \f(CW$file\fR, by splitting the path of \f(CW$file\fR and returning (the volumne and) directory parts. .ie n .IP """relative_to_file($path, $file)""" 4 .el .IP "\f(CWrelative_to_file($path, $file)\fR" 4 .IX Item "relative_to_file($path, $file)" Returns the path of \f(CW$path\fR relative to the directory of file \&\f(CW$file\fR. If \f(CW$path\fR is absolute, just returns \f(CW$path\fR. .ie n .IP """resolve_all($file)""" 4 .el .IP "\f(CWresolve_all($file)\fR" 4 .IX Item "resolve_all($file)" Returns the filename of \f(CW$file\fR with all links in the path resolved, wihout using \f(CW\*(C`Cwd\*(C'\fR. .ie n .IP """full_resolve($file)""" 4 .el .IP "\f(CWfull_resolve($file)\fR" 4 .IX Item "full_resolve($file)" Returns the filename of \f(CW$file\fR with all links in the path resolved. .Sp This sub tries to use \f(CW\*(C`Cwd::abs_path\*(C'\fR via \f(CW\*(C`\->resolve_path\*(C'\fR. .ie n .IP """resolve_path($file)""" 4 .el .IP "\f(CWresolve_path($file)\fR" 4 .IX Item "resolve_path($file)" Returns the filename of \f(CW$file\fR with all links in the path resolved. .Sp This sub uses \f(CW\*(C`Cwd::abs_path\*(C'\fR and is independent of the rest of \&\f(CW\*(C`File::Spec::Link\*(C'\fR. .SS "Object methods" .IX Subsection "Object methods" .ie n .IP """new([$path])""" 4 .el .IP "\f(CWnew([$path])\fR" 4 .IX Item "new([$path])" create new path object: stores path as a list .ie n .IP """path""" 4 .el .IP "\f(CWpath\fR" 4 .IX Item "path" returns path as a string, using catpath .ie n .IP """canonical""" 4 .el .IP "\f(CWcanonical\fR" 4 .IX Item "canonical" returns canonical path, using canonpath .ie n .IP """vol""" 4 .el .IP "\f(CWvol\fR" 4 .IX Item "vol" returns volume element of path, see File::Spec\->splitpath .ie n .IP """dir""" 4 .el .IP "\f(CWdir\fR" 4 .IX Item "dir" returns directory element of path, as a string, see File::Spec\->splitpath .ie n .IP """dirs""" 4 .el .IP "\f(CWdirs\fR" 4 .IX Item "dirs" return list of directory components in path, see File::Spec\->splitdir .ie n .IP """pop""" 4 .el .IP "\f(CWpop\fR" 4 .IX Item "pop" remove last component of the path .ie n .IP """push($file)""" 4 .el .IP "\f(CWpush($file)\fR" 4 .IX Item "push($file)" add a file component to the path, ignoring empty strings .ie n .IP """add($file)""" 4 .el .IP "\f(CWadd($file)\fR" 4 .IX Item "add($file)" add a component to the path: treating \f(CW\*(C`updir\*(C'\fR as \f(CW\*(C`pop\*(C'\fR, and ignoring \f(CW\*(C`curdir\*(C'\fR and empty strings .ie n .IP """split($path)""" 4 .el .IP "\f(CWsplit($path)\fR" 4 .IX Item "split($path)" populate a path object, using splitpath .ie n .IP """chop""" 4 .el .IP "\f(CWchop\fR" 4 .IX Item "chop" remove and return a file component from path, an empty string returns means this was root dir. .ie n .IP """relative($path)""" 4 .el .IP "\f(CWrelative($path)\fR" 4 .IX Item "relative($path)" replace the path object with the supplied path, where the new path is relative to the path object .ie n .IP """follow""" 4 .el .IP "\f(CWfollow\fR" 4 .IX Item "follow" follow the link, where the path object is a link .ie n .IP """resolved""" 4 .el .IP "\f(CWresolved\fR" 4 .IX Item "resolved" resolve the path object, by repeatedly following links .ie n .IP """resolvedir""" 4 .el .IP "\f(CWresolvedir\fR" 4 .IX Item "resolvedir" resolve the links at all component levels within the path object .SS "Other class methods" .IX Subsection "Other class methods" .ie n .IP """canonpath($path)""" 4 .el .IP "\f(CWcanonpath($path)\fR" 4 .IX Item "canonpath($path)" Wrapper round File::Spec::canonpath, fatal if empty input .ie n .IP """catdir(@dirs)""" 4 .el .IP "\f(CWcatdir(@dirs)\fR" 4 .IX Item "catdir(@dirs)" Wrapper round File::Spec::catdir, returns \f(CW\*(C`curdir\*(C'\fR from empty list .ie n .IP """splitlast($path)""" 4 .el .IP "\f(CWsplitlast($path)\fR" 4 .IX Item "splitlast($path)" Get component from \f(CW$path\fR (using \f(CW\*(C`chop\*(C'\fR) and returns remaining path and compenent, as strings. [Not used] .SS "\s-1EXPORT\s0" .IX Subsection "EXPORT" None \- all subs are methods for \f(CW\*(C`File::Spec::Link\*(C'\fR. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fBFile::Spec\fR\|(3) \fBFile::Copy::Link\fR\|(3) .SH "AUTHOR" .IX Header "AUTHOR" Robin Barker, .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" Copyright 2003, 2005, 2006, 2007, 2011, 2014 by Robin Barker .PP This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.