EPOC update from Olaf Flebbe.
[p5sagit/p5-mst-13.2.git] / lib / File / Spec / Epoc.pm
CommitLineData
fa6a1c44 1package File::Spec::Epoc;
2
8de1277c 3our $VERSION = '1.00';
4
fa6a1c44 5use strict;
6use Cwd;
7use vars qw(@ISA);
8require File::Spec::Unix;
9@ISA = qw(File::Spec::Unix);
10
11=head1 NAME
12
13File::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
21See File::Spec::Unix for a documentation of the methods provided
22there. This package overrides the implementation of these methods, not
23the semantics.
24
25This package is still work in progress ;-)
26o.flebbe@gmx.de
27
28
4ac9195f 29=over 4
fa6a1c44 30
fa6a1c44 31sub case_tolerant {
32 return 1;
33}
34
59605c55 35=item canonpath()
fa6a1c44 36
37No physical check on the filesystem, but a logical cleanup of a
38path. On UNIX eliminated successive slashes and successive "/.".
39
40=cut
41
42sub canonpath {
43 my ($self,$path) = @_;
fa6a1c44 44
2585f9a3 45 $path =~ s|/+|/|g; # xx////xx -> xx/xx
fa6a1c44 46 $path =~ s|(/\.)+/|/|g; # xx/././xx -> xx/xx
47 $path =~ s|^(\./)+||s unless $path eq "./"; # ./xx -> xx
48 $path =~ s|^/(\.\./)+|/|s; # /../../xx -> xx
2585f9a3 49 $path =~ s|/\Z(?!\n)|| unless $path eq "/"; # xx/ -> xx
fa6a1c44 50 return $path;
51}
52
fa6a1c44 53=back
54
55=head1 SEE ALSO
56
57L<File::Spec>
58
59=cut
60
611;