diff options
| author | fukachan <fukachan> | 2003-09-17 04:14:53 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2003-09-17 04:14:53 +0000 |
| commit | 9ee1a11ec93a89feb054ac0a9b1999d29708dcfe (patch) | |
| tree | bac6c747a0294145109be9efd81621099d05288b /cpan/lib/File | |
| parent | 0db4bf5bef9912092c3f5188b9de45b773663de1 (diff) | |
| download | fml8-9ee1a11ec93a89feb054ac0a9b1999d29708dcfe.tar.gz fml8-9ee1a11ec93a89feb054ac0a9b1999d29708dcfe.tar.bz2 fml8-9ee1a11ec93a89feb054ac0a9b1999d29708dcfe.zip | |
Initial revision
Diffstat (limited to 'cpan/lib/File')
| -rw-r--r-- | cpan/lib/File/Spec/Cygwin.pm | 87 | ||||
| -rw-r--r-- | cpan/lib/File/Spec/Epoc.pm | 70 |
2 files changed, 157 insertions, 0 deletions
diff --git a/cpan/lib/File/Spec/Cygwin.pm b/cpan/lib/File/Spec/Cygwin.pm new file mode 100644 index 00000000..0712add8 --- /dev/null +++ b/cpan/lib/File/Spec/Cygwin.pm @@ -0,0 +1,87 @@ +package File::Spec::Cygwin; + +use strict; +use vars qw(@ISA $VERSION); +require File::Spec::Unix; + +$VERSION = '1.1'; + +@ISA = qw(File::Spec::Unix); + +=head1 NAME + +File::Spec::Cygwin - methods for Cygwin file specs + +=head1 SYNOPSIS + + require File::Spec::Cygwin; # Done internally by File::Spec if needed + +=head1 DESCRIPTION + +See L<File::Spec> and L<File::Spec::Unix>. This package overrides the +implementation of these methods, not the semantics. + +This module is still in beta. Cygwin-knowledgeable folks are invited +to offer patches and suggestions. + +=cut + +=pod + +=over 4 + +=item canonpath + +Any C<\> (backslashes) are converted to C</> (forward slashes), +and then File::Spec::Unix canonpath() is called on the result. + +=cut + +sub canonpath { + my($self,$path) = @_; + $path =~ s|\\|/|g; + return $self->SUPER::canonpath($path); +} + +=pod + +=item file_name_is_absolute + +True is returned if the file name begins with C<drive_letter:>, +and if not, File::Spec::Unix file_name_is_absolute() is called. + +=cut + + +sub file_name_is_absolute { + my ($self,$file) = @_; + return 1 if $file =~ m{^([a-z]:)?[\\/]}is; # C:/test + return $self->SUPER::file_name_is_absolute($file); +} + +=item tmpdir (override) + +Returns a string representation of the first existing directory +from the following list: + + $ENV{TMPDIR} + /tmp + C:/temp + +Since Perl 5.8.0, if running under taint mode, and if the environment +variables are tainted, they are not used. + +=cut + +my $tmpdir; +sub tmpdir { + return $tmpdir if defined $tmpdir; + my $self = shift; + $tmpdir = $self->_tmpdir( $ENV{TMPDIR}, "/tmp", 'C:/temp' ); +} + +=back + +=cut + +1; diff --git a/cpan/lib/File/Spec/Epoc.pm b/cpan/lib/File/Spec/Epoc.pm new file mode 100644 index 00000000..89ca0b99 --- /dev/null +++ b/cpan/lib/File/Spec/Epoc.pm @@ -0,0 +1,70 @@ +package File::Spec::Epoc; + +use strict; +use vars qw($VERSION @ISA); + +$VERSION = '1.1'; + +require File::Spec::Unix; +@ISA = qw(File::Spec::Unix); + +=head1 NAME + +File::Spec::Epoc - methods for Epoc file specs + +=head1 SYNOPSIS + + require File::Spec::Epoc; # Done internally by File::Spec if needed + +=head1 DESCRIPTION + +See File::Spec::Unix for a documentation of the methods provided +there. This package overrides the implementation of these methods, not +the semantics. + +This package is still work in progress ;-) + +=head1 AUTHORS + +o.flebbe@gmx.de + +=cut + +sub case_tolerant { + return 1; +} + +=pod + +=over 4 + +=item canonpath() + +No physical check on the filesystem, but a logical cleanup of a +path. On UNIX eliminated successive slashes and successive "/.". + +=back + +=cut + +sub canonpath { + my ($self,$path) = @_; + + $path =~ s|/+|/|g; # xx////xx -> xx/xx + $path =~ s|(/\.)+/|/|g; # xx/././xx -> xx/xx + $path =~ s|^(\./)+||s unless $path eq "./"; # ./xx -> xx + $path =~ s|^/(\.\./)+|/|s; # /../../xx -> xx + $path =~ s|/\Z(?!\n)|| unless $path eq "/"; # xx/ -> xx + return $path; +} + +=pod + +=head1 SEE ALSO + +See L<File::Spec> and L<File::Spec::Unix>. This package overrides the +implementation of these methods, not the semantics. + +=cut + +1; |
