X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FFile%2FSpec.pm;h=365c0c58a726ab36105b1a681751ba4eef2447a4;hb=196ac2fcd2dad2d042479c51fe09289545232c66;hp=0c8cd21e057f5e342556c61574c284e0425431a7;hpb=f5f48b4d8916a5316bf55ddba4047be421aaecfe;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/File/Spec.pm b/lib/File/Spec.pm index 0c8cd21..365c0c5 100644 --- a/lib/File/Spec.pm +++ b/lib/File/Spec.pm @@ -3,7 +3,7 @@ package File::Spec; use strict; use vars qw(@ISA $VERSION); -$VERSION = '3.12'; +$VERSION = '3.25'; $VERSION = eval $VERSION; my %module = (MacOS => 'Mac', @@ -83,6 +83,7 @@ forms of these methods. =over 2 =item canonpath +X No physical check on the filesystem, but a logical cleanup of a path. @@ -97,6 +98,7 @@ processing, you probably want C's C function to actually traverse the filesystem cleaning up paths like this. =item catdir +X Concatenate two or more directory names to form a complete path ending with a directory. But remove the trailing slash from the resulting @@ -107,6 +109,7 @@ trailing slash :-) $path = File::Spec->catdir( @directories ); =item catfile +X Concatenate one or more directory names and a filename to form a complete path ending with a filename @@ -114,24 +117,28 @@ complete path ending with a filename $path = File::Spec->catfile( @directories, $filename ); =item curdir +X Returns a string representation of the current directory. $curdir = File::Spec->curdir(); =item devnull +X Returns a string representation of the null device. $devnull = File::Spec->devnull(); =item rootdir +X Returns a string representation of the root directory. $rootdir = File::Spec->rootdir(); =item tmpdir +X Returns a string representation of the first writable directory from a list of possible temporary directories. Returns the current directory @@ -142,6 +149,7 @@ checked depends on the platform; e.g. File::Spec::Unix checks C<$ENV{TMPDIR}> $tmpdir = File::Spec->tmpdir(); =item updir +X Returns a string representation of the parent directory. @@ -172,6 +180,7 @@ Mac OS (Classic). It does consult the working environment for VMS (see L). =item path +X Takes no argument. Returns the environment variable C (or the local platform's equivalent) as a list. @@ -179,10 +188,12 @@ platform's equivalent) as a list. @PATH = File::Spec->path(); =item join +X join is the same as catfile. =item splitpath +X X Splits a path in to volume, directory, and filename portions. On systems with no concept of volume, returns '' for volume. @@ -201,6 +212,7 @@ The results can be passed to L to get back a path equivalent to (usually identical to) the original path. =item splitdir +X X The opposite of L. @@ -223,6 +235,7 @@ inserted if need be. On other OSes, C<$volume> is significant. $full_path = File::Spec->catpath( $volume, $directory, $file ); =item abs2rel +X X X Takes a destination path and an optional base path returns a relative path from the base path to the destination path: @@ -230,10 +243,10 @@ from the base path to the destination path: $rel_path = File::Spec->abs2rel( $path ) ; $rel_path = File::Spec->abs2rel( $path, $base ) ; -If C<$base> is not present or '', then L is used. If C<$base> is +If C<$base> is not present or '', then L is used. If C<$base> is relative, then it is converted to absolute form using L. This means that it is taken to be relative to -L. +L. On systems with the concept of volume, if C<$path> and C<$base> appear to be on two different volumes, we will not attempt to resolve the two @@ -246,7 +259,7 @@ C<$base> filename as well. Otherwise all path components are assumed to be directories. If C<$path> is relative, it is converted to absolute form using L. -This means that it is taken to be relative to L. +This means that it is taken to be relative to L. No checks against the filesystem are made. On VMS, there is interaction with the working environment, as logicals and @@ -255,15 +268,16 @@ macros are expanded. Based on code written by Shigio Yamaguchi. =item rel2abs() +X X X Converts a relative path to an absolute path. $abs_path = File::Spec->rel2abs( $path ) ; $abs_path = File::Spec->rel2abs( $path, $base ) ; -If C<$base> is not present or '', then L is used. If C<$base> is relative, +If C<$base> is not present or '', then L is used. If C<$base> is relative, then it is converted to absolute form using L. This means that it -is taken to be relative to L. +is taken to be relative to L. On systems with the concept of volume, if C<$path> and C<$base> appear to be on two different volumes, we will not attempt to resolve the two