Lines Matching defs:path

38     my ($self,$path) = @_;
39 return $path;
44 Concatenate two or more directory names to form a path separated by colons
47 puts a trailing ":" on the end of the complete path, because that's what's
48 done in MacPerl's environment and helps to distinguish a file path from a
49 directory path.
52 path is relative by default and I<not> absolute. This decision was made due
62 is a path, but not a name, since it contains a punctuation character ":").
87 The resulting path is relative by default, i.e. the resulting path will have a
92 A trailing colon is added automatically to the resulting path, to denote a
105 When an updir path like ":::lib::" is passed as argument, the number
114 Adding a colon ":" or empty string "" to a path at I<any> position
115 doesn't alter the path, i.e. these arguments are ignored. (When a ""
128 the pattern /^[^:]+:/, the resulting path is B<absolute>.
167 arguments that move up the directory tree, an invalid path going
172 As you've seen, you can force C<catdir()> to create an absolute path
173 by passing either an empty string or a path that begins with a volume
179 returns an entire path. While C<catdir()> is still suitable for the
202 if ($args[0] eq '') { # absolute path, rootdir
207 } elsif ($args[0] =~ /^[^:]+:/) { # absolute path, volume name
210 # add a trailing ':' if need be (may be it's a path like HD:dir)
213 } else { # relative path
216 # updir colon path ('::', ':::' etc.), don't shift
238 if ($arg =~ /^::+\Z(?!\n)/ ) { # updir colon path like ':::'
240 while ((@args) && ($args[0] =~ /^::+\Z(?!\n)/) ) { # while updir colon path
269 complete path ending with a filename. Resulting paths are B<relative>
273 resulting path is relative by default and I<not> absolute. This
351 contain a path like "MacintoshHD:Temporary Items:", which is a hidden
374 Takes as argument a path and returns true, if it is an absolute path.
375 If the path has a leading ":", it's a relative path. Otherwise, it's an
376 absolute path, unless the path doesn't contain any colons, i.e. it's a name
377 like "a". In this particular case, the path is considered to be relative
379 in the path if you want to distinguish unambiguously. As a special case,
405 =item path
414 sub path {
425 ($volume,$directories,$file) = File::Spec->splitpath( $path );
426 ($volume,$directories,$file) = File::Spec->splitpath( $path,
429 Splits a path into volume, directory, and filename portions.
431 On Mac OS, assumes that the last part of the path is a filename unless
435 is always returned with a leading (to denote a relative path) and a trailing ":"
439 The results can be passed to C<catpath()> to get back a path equivalent to
440 (usually identical to) the original path.
446 my ($self,$path, $nofile) = @_;
450 ( $volume, $directory ) = $path =~ m|^((?:[^:]+:)?)(.*)|s;
453 $path =~
484 $directories should be only the directory portion of the path on systems
485 that have the concept of a volume or that have path syntax that differentiates
490 colon to distinguish a directory path from a file path, a single trailing colon
514 my ($self, $path) = @_;
518 return @result if ( (!defined($path)) || ($path eq '') );
519 return (':') if ($path eq ':');
521 ( $volume, $sep, $directories ) = $path =~ m|^((?:[^:]+:)?)(:*)(.*)|s;
551 $path = File::Spec->catpath($volume,$directory,$file);
553 Takes volume, directory and file portions and returns an entire path. On Mac OS,
556 string is returned. If $volume is empty, the result will be a relative path,
559 resulting path will have a trailing ':'.
577 my $path = $volume; # may be ''
578 $path .= ':' unless (substr($path, -1) eq ':'); # ensure trailing ':'
583 $path .= $directory;
584 $path .= ':' unless (substr($path, -1) eq ':'); # ensure trailing ':'
589 $path .= $file;
592 return $path;
597 Takes a destination path and an optional base path and returns a relative path
598 from the base path to the destination path:
600 $rel_path = File::Spec->abs2rel( $path ) ;
601 $rel_path = File::Spec->abs2rel( $path, $base ) ;
604 directory path (with trailing ':') from a file path (without trailing ':').
610 If $path and $base appear to be on two different volumes, we will not
612 $path. Note that previous versions of this module ignored the volume
616 assumed to be a filename. This filename is ignored. Otherwise all path
619 If $path is relative, it is converted to absolute form using C<rel2abs()>.
629 my $path = shift @_;
634 $proceed = ($path =~ s/^(.*):[^:]+::(.*?)\z/$1:$2/);
637 return $path;
642 my($self,$path,$base) = @_;
644 # Clean up $path
645 if ( ! $self->file_name_is_absolute( $path ) ) {
646 $path = $self->rel2abs( $path ) ;
662 my ( $path_vol, $path_dirs, $path_file ) = $self->splitpath( $path );
665 return $path unless lc( $path_vol ) eq lc( $base_vol );
679 # ensure relative path, even if @pathchunks is empty
690 Converts a relative path to an absolute path:
692 $abs_path = File::Spec->rel2abs( $path ) ;
693 $abs_path = File::Spec->rel2abs( $path, $base ) ;
696 directory path (with trailing ':') from a file path (without trailing ':').
704 assumed to be a filename. This filename is ignored. Otherwise all path
707 If $path is already absolute, it is returned and $base is ignored.
714 my ($self,$path,$base) = @_;
716 if ( ! $self->file_name_is_absolute($path) ) {
727 # ignore $path's volume
728 my ( $path_dirs, $path_file ) = ($self->splitpath($path))[1,2] ;
738 $path = $self->catpath( $base_vol, $base_dirs, $path_file );
740 return $path;