Check VERSIONs.
[p5sagit/p5-mst-13.2.git] / lib / File / Spec / OS2.pm
1 package File::Spec::OS2;
2
3 use strict;
4 use vars qw(@ISA $VERSION);
5 require File::Spec::Unix;
6 @ISA = qw(File::Spec::Unix);
7
8 $VERSION = 1.0;
9
10 sub devnull {
11     return "/dev/nul";
12 }
13
14 sub case_tolerant {
15     return 1;
16 }
17
18 sub file_name_is_absolute {
19     my ($self,$file) = @_;
20     return scalar($file =~ m{^([a-z]:)?[\\/]}is);
21 }
22
23 sub path {
24     my $path = $ENV{PATH};
25     $path =~ s:\\:/:g;
26     my @path = split(';',$path);
27     foreach (@path) { $_ = '.' if $_ eq '' }
28     return @path;
29 }
30
31 my $tmpdir;
32 sub 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;
44 }
45
46 1;
47 __END__
48
49 =head1 NAME
50
51 File::Spec::OS2 - methods for OS/2 file specs
52
53 =head1 SYNOPSIS
54
55  require File::Spec::OS2; # Done internally by File::Spec if needed
56
57 =head1 DESCRIPTION
58
59 See File::Spec::Unix for a documentation of the methods provided
60 there. This package overrides the implementation of these methods, not
61 the semantics.