1N/Apackage File::Spec::Epoc;
1N/A
1N/Ause strict;
1N/Ause vars qw($VERSION @ISA);
1N/A
1N/A$VERSION = '1.1';
1N/A
1N/Arequire File::Spec::Unix;
1N/A@ISA = qw(File::Spec::Unix);
1N/A
1N/A=head1 NAME
1N/A
1N/AFile::Spec::Epoc - methods for Epoc file specs
1N/A
1N/A=head1 SYNOPSIS
1N/A
1N/A require File::Spec::Epoc; # Done internally by File::Spec if needed
1N/A
1N/A=head1 DESCRIPTION
1N/A
1N/ASee File::Spec::Unix for a documentation of the methods provided
1N/Athere. This package overrides the implementation of these methods, not
1N/Athe semantics.
1N/A
1N/AThis package is still work in progress ;-)
1N/A
1N/A=head1 AUTHORS
1N/A
1N/Ao.flebbe@gmx.de
1N/A
1N/A=cut
1N/A
1N/Asub case_tolerant {
1N/A return 1;
1N/A}
1N/A
1N/A=pod
1N/A
1N/A=over 4
1N/A
1N/A=item canonpath()
1N/A
1N/ANo physical check on the filesystem, but a logical cleanup of a
1N/Apath. On UNIX eliminated successive slashes and successive "/.".
1N/A
1N/A=back
1N/A
1N/A=cut
1N/A
1N/Asub canonpath {
1N/A my ($self,$path) = @_;
1N/A
1N/A $path =~ s|/+|/|g; # xx////xx -> xx/xx
1N/A $path =~ s|(/\.)+/|/|g; # xx/././xx -> xx/xx
1N/A $path =~ s|^(\./)+||s unless $path eq "./"; # ./xx -> xx
1N/A $path =~ s|^/(\.\./)+|/|s; # /../../xx -> xx
1N/A $path =~ s|/\Z(?!\n)|| unless $path eq "/"; # xx/ -> xx
1N/A return $path;
1N/A}
1N/A
1N/A=pod
1N/A
1N/A=head1 SEE ALSO
1N/A
1N/ASee L<File::Spec> and L<File::Spec::Unix>. This package overrides the
1N/Aimplementation of these methods, not the semantics.
1N/A
1N/A=cut
1N/A
1N/A1;