Commit | Line | Data |
270d1e39 |
1 | package File::Spec::OS2; |
2 | |
270d1e39 |
3 | use strict; |
270d1e39 |
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 | |
12 | sub file_name_is_absolute { |
cbc7acb0 |
13 | my ($self,$file) = @_; |
14 | return scalar($file =~ m{^([a-z]:)?[\\/]}i); |
270d1e39 |
15 | } |
16 | |
17 | sub path { |
270d1e39 |
18 | my $path = $ENV{PATH}; |
19 | $path =~ s:\\:/:g; |
cbc7acb0 |
20 | my @path = split(';',$path); |
21 | foreach (@path) { $_ = '.' if $_ eq '' } |
22 | return @path; |
270d1e39 |
23 | } |
24 | |
cbc7acb0 |
25 | my $tmpdir; |
26 | sub tmpdir { |
27 | return $tmpdir if defined $tmpdir; |
28 | my $self = shift; |
29 | foreach (@ENV{qw(TMPDIR TEMP TMP)}, qw(/tmp /)) { |
30 | next unless defined && -d; |
31 | $tmpdir = $_; |
32 | last; |
33 | } |
34 | $tmpdir = '' unless defined $tmpdir; |
35 | $tmpdir =~ s:\\:/:g; |
36 | $tmpdir = $self->canonpath($tmpdir); |
37 | return $tmpdir; |
99804bbb |
38 | } |
39 | |
270d1e39 |
40 | 1; |
41 | __END__ |
42 | |
43 | =head1 NAME |
44 | |
45 | File::Spec::OS2 - methods for OS/2 file specs |
46 | |
47 | =head1 SYNOPSIS |
48 | |
cbc7acb0 |
49 | require File::Spec::OS2; # Done internally by File::Spec if needed |
270d1e39 |
50 | |
51 | =head1 DESCRIPTION |
52 | |
53 | See File::Spec::Unix for a documentation of the methods provided |
54 | there. This package overrides the implementation of these methods, not |
55 | the semantics. |