This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Get C++ compiles going on Solaris again.
[perl5.git] / lib / File / Spec / Epoc.pm
CommitLineData
fa6a1c44
OF
1package File::Spec::Epoc;
2
3use strict;
07824bd1
JH
4use vars qw($VERSION @ISA);
5
c7e4122e 6$VERSION = '3.2501';
07824bd1 7
fa6a1c44
OF
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 ;-)
fa6a1c44 26
e021ab8e 27=cut
fa6a1c44 28
fa6a1c44
OF
29sub case_tolerant {
30 return 1;
31}
32
e021ab8e
JH
33=pod
34
35=over 4
36
59605c55 37=item canonpath()
fa6a1c44
OF
38
39No physical check on the filesystem, but a logical cleanup of a
40path. On UNIX eliminated successive slashes and successive "/.".
41
e021ab8e
JH
42=back
43
fa6a1c44
OF
44=cut
45
46sub canonpath {
47 my ($self,$path) = @_;
fa6a1c44 48
2585f9a3 49 $path =~ s|/+|/|g; # xx////xx -> xx/xx
fa6a1c44
OF
50 $path =~ s|(/\.)+/|/|g; # xx/././xx -> xx/xx
51 $path =~ s|^(\./)+||s unless $path eq "./"; # ./xx -> xx
52 $path =~ s|^/(\.\./)+|/|s; # /../../xx -> xx
2585f9a3 53 $path =~ s|/\Z(?!\n)|| unless $path eq "/"; # xx/ -> xx
fa6a1c44
OF
54 return $path;
55}
56
72f15715
T
57=pod
58
99f36a73
RGS
59=head1 AUTHOR
60
61o.flebbe@gmx.de
62
63=head1 COPYRIGHT
64
65Copyright (c) 2004 by the Perl 5 Porters. All rights reserved.
66
67This program is free software; you can redistribute it and/or modify
68it under the same terms as Perl itself.
69
fa6a1c44
OF
70=head1 SEE ALSO
71
72f15715
T
72See L<File::Spec> and L<File::Spec::Unix>. This package overrides the
73implementation of these methods, not the semantics.
fa6a1c44
OF
74
75=cut
76
771;