Up the F::S subpackage versions; up the JPL JNI.pm version
[p5sagit/p5-mst-13.2.git] / lib / File / Spec / Cygwin.pm
CommitLineData
ecf68df6 1package File::Spec::Cygwin;
2
3use strict;
4use vars qw(@ISA $VERSION);
5require File::Spec::Unix;
6
6f0dcf97 7$VERSION = '1.1';
ecf68df6 8
9@ISA = qw(File::Spec::Unix);
10
07824bd1 11=head1 NAME
12
13File::Spec::Cygwin - methods for Cygwin file specs
14
15=head1 SYNOPSIS
16
17 require File::Spec::Cygwin; # 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 module is still in beta. Cygwin-knowledgeable folks are invited
26to offer patches and suggestions.
27
28=cut
29
30=pod
31
32=item canonpath
33
34Any C<\> (backslashes) are converted to C</> (forward slashes),
35and then File::Spec::Unix canonpath() is called on the result.
36
37=cut
38
ecf68df6 39sub canonpath {
40 my($self,$path) = @_;
41 $path =~ s|\\|/|g;
42 return $self->SUPER::canonpath($path);
43}
44
07824bd1 45=pod
46
47=item file_name_is_absolute
48
49True is returned if the file name begins with C<drive_letter:>,
50and if not, File::Spec::Unix file_name_is_absolute() is called.
51
52=cut
53
54
3ed25742 55sub file_name_is_absolute {
56 my ($self,$file) = @_;
57 return 1 if $file =~ m{^([a-z]:)?[\\/]}is; # C:/test
58 return $self->SUPER::file_name_is_absolute($file);
59}
60
07824bd1 61=item tmpdir (override)
f534ab20 62
07824bd1 63Returns a string representation of the first existing directory
64from the following list:
ecf68df6 65
07824bd1 66 $ENV{TMPDIR}
67 /tmp
68 C:/temp
ecf68df6 69
07824bd1 70Since Perl 5.8.0, if running under taint mode, and if the environment
71variables are tainted, they are not used.
ecf68df6 72
07824bd1 73=cut
ecf68df6 74
07824bd1 75my $tmpdir;
76sub tmpdir {
77 return $tmpdir if defined $tmpdir;
78 my $self = shift;
79 $tmpdir = $self->_tmpdir( $ENV{TMPDIR}, "/tmp", 'C:/temp' );
80}
ecf68df6 81
07824bd1 821;