Commit | Line | Data |
270d1e39 |
1 | package File::Spec::OS2; |
2 | |
270d1e39 |
3 | use strict; |
b4408b25 |
4 | use vars qw(@ISA); |
cbc7acb0 |
5 | require File::Spec::Unix; |
270d1e39 |
6 | @ISA = qw(File::Spec::Unix); |
7 | |
cbc7acb0 |
8 | sub devnull { |
9 | return "/dev/nul"; |
10 | } |
270d1e39 |
11 | |
46726cbe |
12 | sub case_tolerant { |
13 | return 1; |
14 | } |
15 | |
270d1e39 |
16 | sub file_name_is_absolute { |
cbc7acb0 |
17 | my ($self,$file) = @_; |
1b1e14d3 |
18 | return scalar($file =~ m{^([a-z]:)?[\\/]}is); |
270d1e39 |
19 | } |
20 | |
21 | sub 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 |
29 | my $tmpdir; |
30 | sub 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 |
44 | 1; |
45 | __END__ |
46 | |
47 | =head1 NAME |
48 | |
49 | File::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 | |
57 | See File::Spec::Unix for a documentation of the methods provided |
58 | there. This package overrides the implementation of these methods, not |
59 | the semantics. |