| 1 | package File::Spec::Epoc; | ||||||||||
| 2 | |||||||||||
| 3 | 2 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | |||||||||||
| 5 | 2 | our $VERSION = '3.75'; | |||||||||
| 6 | 2 | $VERSION =~ tr/_//d; | |||||||||
| 7 | |||||||||||
| 8 | 2 | require File::Spec::Unix; | |||||||||
| 9 | 2 | our @ISA = qw(File::Spec::Unix); | |||||||||
| 10 | |||||||||||
| 11 | =head1 NAME | ||||||||||
| 12 | |||||||||||
| 13 | File::Spec::Epoc - methods for Epoc file specs | ||||||||||
| 14 | |||||||||||
| 15 | =head1 SYNOPSIS | ||||||||||
| 16 | |||||||||||
| 17 | require File::Spec::Epoc; # Done internally by File::Spec if needed | ||||||||||
| 18 | |||||||||||
| 19 | =head1 DESCRIPTION | ||||||||||
| 20 | |||||||||||
| 21 | See File::Spec::Unix for a documentation of the methods provided | ||||||||||
| 22 | there. This package overrides the implementation of these methods, not | ||||||||||
| 23 | the semantics. | ||||||||||
| 24 | |||||||||||
| 25 | This package is still a work in progress. ;-) | ||||||||||
| 26 | |||||||||||
| 27 | =cut | ||||||||||
| 28 | |||||||||||
| 29 | 1 | ▶ | sub case_tolerant { | ||||||||
|
Subroutine
case_tolerant: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 30 | 1 | return 1; | |||||||||
| 31 | } | ||||||||||
| 32 | |||||||||||
| 33 | =pod | ||||||||||
| 34 | |||||||||||
| 35 | =over 4 | ||||||||||
| 36 | |||||||||||
| 37 | =item canonpath() | ||||||||||
| 38 | |||||||||||
| 39 | No physical check on the filesystem, but a logical cleanup of a | ||||||||||
| 40 | path. On UNIX eliminated successive slashes and successive "/.". | ||||||||||
| 41 | |||||||||||
| 42 | =back | ||||||||||
| 43 | |||||||||||
| 44 | =cut | ||||||||||
| 45 | |||||||||||
| 46 | 72 | ▶ | sub canonpath { | ||||||||
|
Subroutine
canonpath: called CC=4 SCAR=13.9
Pod
documented
| |||||||||||
| 47 | 72 | my ($self,$path) = @_; | |||||||||
| 48 | 72 | ▶ | return unless defined $path; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 49 | |||||||||||
| 50 | 70 | $path =~ s|/+|/|g; # xx////xx -> xx/xx | |||||||||
| 51 | 70 | $path =~ s|(/\.)+/|/|g; # xx/././xx -> xx/xx | |||||||||
| 52 | 70 | ▶ | $path =~ s|^(\./)+||s unless $path eq "./"; # ./xx -> xx | ||||||||
|
Branch: 1 branch
| |||||||||||
| 53 | 70 | $path =~ s|^/(\.\./)+|/|s; # /../../xx -> xx | |||||||||
| 54 | 70 | ▶ | $path =~ s|/\Z(?!\n)|| unless $path eq "/"; # xx/ -> xx | ||||||||
|
Branch: 1 branch
| |||||||||||
| 55 | 70 | return $path; | |||||||||
| 56 | } | ||||||||||
| 57 | |||||||||||
| 58 | =pod | ||||||||||
| 59 | |||||||||||
| 60 | =head1 AUTHOR | ||||||||||
| 61 | |||||||||||
| 62 | o.flebbe@gmx.de | ||||||||||
| 63 | |||||||||||
| 64 | =head1 COPYRIGHT | ||||||||||
| 65 | |||||||||||
| 66 | Copyright (c) 2004 by the Perl 5 Porters. All rights reserved. | ||||||||||
| 67 | |||||||||||
| 68 | This program is free software; you can redistribute it and/or modify | ||||||||||
| 69 | it under the same terms as Perl itself. | ||||||||||
| 70 | |||||||||||
| 71 | =head1 SEE ALSO | ||||||||||
| 72 | |||||||||||
| 73 | See L<File::Spec> and L<File::Spec::Unix>. This package overrides the | ||||||||||
| 74 | implementation of these methods, not the semantics. | ||||||||||
| 75 | |||||||||||
| 76 | =cut | ||||||||||
| 77 | |||||||||||
| 78 | 2 | 1; | |||||||||