diff options
Diffstat (limited to 'cpan/lib/File/Spec/Mac.pm')
| -rw-r--r-- | cpan/lib/File/Spec/Mac.pm | 48 |
1 files changed, 30 insertions, 18 deletions
diff --git a/cpan/lib/File/Spec/Mac.pm b/cpan/lib/File/Spec/Mac.pm index 34a7a015..329451fb 100644 --- a/cpan/lib/File/Spec/Mac.pm +++ b/cpan/lib/File/Spec/Mac.pm @@ -4,7 +4,8 @@ use strict; use vars qw(@ISA $VERSION); require File::Spec::Unix; -$VERSION = '1.4'; +$VERSION = '3.62'; +$VERSION =~ tr/_//d; @ISA = qw(File::Spec::Unix); @@ -53,7 +54,7 @@ done in MacPerl's environment and helps to distinguish a file path from a directory path. B<IMPORTANT NOTE:> Beginning with version 1.3 of this module, the resulting -path is relative by default and I<not> absolute. This descision was made due +path is relative by default and I<not> absolute. This decision was made due to portability reasons. Since C<File::Spec-E<gt>catdir()> returns relative paths on all other operating systems, it will now also follow this convention on Mac OS. Note that this may break some existing scripts. @@ -155,13 +156,16 @@ their Unix counterparts: Unix: Unix->catdir("","") = "/" Unix->catdir("",".") = "/" - Unix->catdir("","..") = "/" # can't go beyond root + Unix->catdir("","..") = "/" # can't go + # beyond root Unix->catdir("",".","..","..","a") = "/a" Mac: - Mac->catdir("","") = rootdir() # (e.g. "HD:") + Mac->catdir("","") = rootdir() # (e.g. "HD:") Mac->catdir("",":") = rootdir() - Mac->catdir("","::") = rootdir() # can't go beyond root - Mac->catdir("",":","::","::","a") = rootdir() . "a:" # (e.g. "HD:a:") + Mac->catdir("","::") = rootdir() # can't go + # beyond root + Mac->catdir("",":","::","::","a") = rootdir() . "a:" + # (e.g. "HD:a:") However, this approach is limited to the first arguments following "root" (again, see C<Unix-E<gt>canonpath()> ). If there are more @@ -272,7 +276,7 @@ by default, but can be forced to be absolute (but avoid this). B<IMPORTANT NOTE:> Beginning with version 1.3 of this module, the resulting path is relative by default and I<not> absolute. This -descision was made due to portability reasons. Since +decision was made due to portability reasons. Since C<File::Spec-E<gt>catfile()> returns relative paths on all other operating systems, it will now also follow this convention on Mac OS. Note that this may break some existing scripts. @@ -370,11 +374,10 @@ directory on your startup volume. =cut -my $tmpdir; sub tmpdir { - return $tmpdir if defined $tmpdir; - my $self = shift; - $tmpdir = $self->_tmpdir( $ENV{TMPDIR} ); + my $cached = $_[0]->_cached_tmpdir('TMPDIR'); + return $cached if defined $cached; + $_[0]->_cache_tmpdir($_[0]->_tmpdir( $ENV{TMPDIR} ), 'TMPDIR'); } =item updir @@ -400,10 +403,11 @@ the filename '' is always considered to be absolute. Note that with version E.g. - File::Spec->file_name_is_absolute("a"); # false (relative) - File::Spec->file_name_is_absolute(":a:b:"); # false (relative) - File::Spec->file_name_is_absolute("MacintoshHD:"); # true (absolute) - File::Spec->file_name_is_absolute(""); # true (absolute) + File::Spec->file_name_is_absolute("a"); # false (relative) + File::Spec->file_name_is_absolute(":a:b:"); # false (relative) + File::Spec->file_name_is_absolute("MacintoshHD:"); + # true (absolute) + File::Spec->file_name_is_absolute(""); # true (absolute) =cut @@ -440,7 +444,8 @@ sub path { =item splitpath ($volume,$directories,$file) = File::Spec->splitpath( $path ); - ($volume,$directories,$file) = File::Spec->splitpath( $path, $no_file ); + ($volume,$directories,$file) = File::Spec->splitpath( $path, + $no_file ); Splits a path into volume, directory, and filename portions. @@ -531,7 +536,7 @@ sub splitdir { my @result = (); my ($head, $sep, $tail, $volume, $directories); - return ('') if ( (!defined($path)) || ($path eq '') ); + return @result if ( (!defined($path)) || ($path eq '') ); return (':') if ($path eq ':'); ( $volume, $sep, $directories ) = $path =~ m|^((?:[^:]+:)?)(:*)(.*)|s; @@ -740,7 +745,7 @@ sub rel2abs { # Split up paths - # igonore $path's volume + # ignore $path's volume my ( $path_dirs, $path_file ) = ($self->splitpath($path))[1,2] ; # ignore $base's file part @@ -764,6 +769,13 @@ sub rel2abs { See the authors list in I<File::Spec>. Mac OS support by Paul Schinder <schinder@pobox.com> and Thomas Wegner <wegner_thomas@yahoo.com>. +=head1 COPYRIGHT + +Copyright (c) 2004 by the Perl 5 Porters. All rights reserved. + +This program is free software; you can redistribute it and/or modify +it under the same terms as Perl itself. + =head1 SEE ALSO See L<File::Spec> and L<File::Spec::Unix>. This package overrides the |
