Upgrade to File::Spec 0.810_01 from CPAN by Barrie Slaymaker.
[p5sagit/p5-mst-13.2.git] / lib / File / Spec / OS2.pm
CommitLineData
270d1e39 1package File::Spec::OS2;
2
270d1e39 3use strict;
b4408b25 4use vars qw(@ISA);
cbc7acb0 5require File::Spec::Unix;
270d1e39 6@ISA = qw(File::Spec::Unix);
7
cbc7acb0 8sub devnull {
9 return "/dev/nul";
10}
270d1e39 11
46726cbe 12sub case_tolerant {
13 return 1;
14}
15
270d1e39 16sub file_name_is_absolute {
cbc7acb0 17 my ($self,$file) = @_;
1b1e14d3 18 return scalar($file =~ m{^([a-z]:)?[\\/]}is);
270d1e39 19}
20
21sub path {
270d1e39 22 my $path = $ENV{PATH};
23 $path =~ s:\\:/:g;
cbc7acb0 24 my @path = split(';',$path);
25 foreach (@path) { $_ = '.' if $_ eq '' }
26 return @path;
270d1e39 27}
28
cbc7acb0 29my $tmpdir;
30sub tmpdir {
31 return $tmpdir if defined $tmpdir;
32 my $self = shift;
33 foreach (@ENV{qw(TMPDIR TEMP TMP)}, qw(/tmp /)) {
34 next unless defined && -d;
35 $tmpdir = $_;
36 last;
37 }
38 $tmpdir = '' unless defined $tmpdir;
39 $tmpdir =~ s:\\:/:g;
40 $tmpdir = $self->canonpath($tmpdir);
41 return $tmpdir;
99804bbb 42}
43
270d1e39 441;
45__END__
46
47=head1 NAME
48
49File::Spec::OS2 - methods for OS/2 file specs
50
51=head1 SYNOPSIS
52
cbc7acb0 53 require File::Spec::OS2; # Done internally by File::Spec if needed
270d1e39 54
55=head1 DESCRIPTION
56
57See File::Spec::Unix for a documentation of the methods provided
58there. This package overrides the implementation of these methods, not
59the semantics.