1package File::Spec::Epoc;
2
3use strict;
4
5our $VERSION = '3.88';
6$VERSION =~ tr/_//d;
7
8require File::Spec::Unix;
9our @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 a work in progress. ;-)
26
27=cut
28
29sub case_tolerant {
30    return 1;
31}
32
33=pod
34
35=over 4
36
37=item canonpath()
38
39No physical check on the filesystem, but a logical cleanup of a
40path.  On UNIX eliminated successive slashes and successive "/.".
41
42=back
43
44=cut
45
46sub canonpath {
47    my ($self,$path) = @_;
48    return unless defined $path;
49
50    $path =~ s|/+|/|g;                             # xx////xx  -> xx/xx
51    $path =~ s|(/\.)+/|/|g;                        # xx/././xx -> xx/xx
52    $path =~ s|^(\./)+||s unless $path eq "./";    # ./xx      -> xx
53    $path =~ s|^/(\.\./)+|/|s;                     # /../../xx -> xx
54    $path =~  s|/\Z(?!\n)|| unless $path eq "/";          # xx/       -> xx
55    return $path;
56}
57
58=pod
59
60=head1 AUTHOR
61
62o.flebbe@gmx.de
63
64=head1 COPYRIGHT
65
66Copyright (c) 2004 by the Perl 5 Porters.  All rights reserved.
67
68This program is free software; you can redistribute it and/or modify
69it under the same terms as Perl itself.
70
71=head1 SEE ALSO
72
73See L<File::Spec> and L<File::Spec::Unix>.  This package overrides the
74implementation of these methods, not the semantics.
75
76=cut
77
781;
79