source: trunk/third/perl/lib/File/Spec/OS2.pm @ 14545

Revision 14545, 1.1 KB checked in by ghudson, 24 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r14544, which included commits to RCS files with non-trunk default branches.
Line 
1package File::Spec::OS2;
2
3use strict;
4use vars qw(@ISA);
5require File::Spec::Unix;
6@ISA = qw(File::Spec::Unix);
7
8sub devnull {
9    return "/dev/nul";
10}
11
12sub case_tolerant {
13    return 1;
14}
15
16sub file_name_is_absolute {
17    my ($self,$file) = @_;
18    return scalar($file =~ m{^([a-z]:)?[\\/]}is);
19}
20
21sub path {
22    my $path = $ENV{PATH};
23    $path =~ s:\\:/:g;
24    my @path = split(';',$path);
25    foreach (@path) { $_ = '.' if $_ eq '' }
26    return @path;
27}
28
29my $tmpdir;
30sub 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;
42}
43
441;
45__END__
46
47=head1 NAME
48
49File::Spec::OS2 - methods for OS/2 file specs
50
51=head1 SYNOPSIS
52
53 require File::Spec::OS2; # Done internally by File::Spec if needed
54
55=head1 DESCRIPTION
56
57See File::Spec::Unix for a documentation of the methods provided
58there. This package overrides the implementation of these methods, not
59the semantics.
Note: See TracBrowser for help on using the repository browser.