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