Extra noise from File::Spec.
[p5sagit/p5-mst-13.2.git] / lib / File / Spec / Epoc.pm
CommitLineData
fa6a1c44 1package File::Spec::Epoc;
2
3use strict;
4use Cwd;
07824bd1 5use vars qw($VERSION @ISA);
6
7$VERSION = '1.1';
8
fa6a1c44 9require File::Spec::Unix;
10@ISA = qw(File::Spec::Unix);
11
12=head1 NAME
13
14File::Spec::Epoc - methods for Epoc file specs
15
16=head1 SYNOPSIS
17
18 require File::Spec::Epoc; # Done internally by File::Spec if needed
19
20=head1 DESCRIPTION
21
22See File::Spec::Unix for a documentation of the methods provided
23there. This package overrides the implementation of these methods, not
24the semantics.
25
26This package is still work in progress ;-)
fa6a1c44 27
e021ab8e 28=head1 AUTHORS
fa6a1c44 29
e021ab8e 30o.flebbe@gmx.de
31
32=cut
fa6a1c44 33
fa6a1c44 34sub case_tolerant {
35 return 1;
36}
37
e021ab8e 38=pod
39
40=over 4
41
59605c55 42=item canonpath()
fa6a1c44 43
44No physical check on the filesystem, but a logical cleanup of a
45path. On UNIX eliminated successive slashes and successive "/.".
46
e021ab8e 47=back
48
fa6a1c44 49=cut
50
51sub canonpath {
52 my ($self,$path) = @_;
fa6a1c44 53
2585f9a3 54 $path =~ s|/+|/|g; # xx////xx -> xx/xx
fa6a1c44 55 $path =~ s|(/\.)+/|/|g; # xx/././xx -> xx/xx
56 $path =~ s|^(\./)+||s unless $path eq "./"; # ./xx -> xx
57 $path =~ s|^/(\.\./)+|/|s; # /../../xx -> xx
2585f9a3 58 $path =~ s|/\Z(?!\n)|| unless $path eq "/"; # xx/ -> xx
fa6a1c44 59 return $path;
60}
61
fa6a1c44 62=head1 SEE ALSO
63
64L<File::Spec>
65
66=cut
67
681;