Commit | Line | Data |
---|---|---|
270d1e39 | 1 | package File::Spec::OS2; |
2 | ||
270d1e39 | 3 | use strict; |
90e08c66 | 4 | use vars qw(@ISA $VERSION); |
cbc7acb0 | 5 | require File::Spec::Unix; |
270d1e39 | 6 | @ISA = qw(File::Spec::Unix); |
7 | ||
90e08c66 | 8 | $VERSION = 1.0; |
9 | ||
cbc7acb0 | 10 | sub devnull { |
11 | return "/dev/nul"; | |
12 | } | |
270d1e39 | 13 | |
46726cbe | 14 | sub case_tolerant { |
15 | return 1; | |
16 | } | |
17 | ||
270d1e39 | 18 | sub file_name_is_absolute { |
cbc7acb0 | 19 | my ($self,$file) = @_; |
1b1e14d3 | 20 | return scalar($file =~ m{^([a-z]:)?[\\/]}is); |
270d1e39 | 21 | } |
22 | ||
23 | sub 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 | 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; | |
99804bbb | 44 | } |
45 | ||
270d1e39 | 46 | 1; |
47 | __END__ | |
48 | ||
49 | =head1 NAME | |
50 | ||
51 | File::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 | ||
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. |