Revision 17035,
1.1 KB
checked in by zacheiss, 22 years ago
(diff) |
This commit was generated by cvs2svn to compensate for changes in r17034,
which included commits to RCS files with non-trunk default branches.
|
Rev | Line | |
---|
[14544] | 1 | package File::Spec::OS2; |
---|
| 2 | |
---|
| 3 | use strict; |
---|
[17034] | 4 | use vars qw(@ISA $VERSION); |
---|
[14544] | 5 | require File::Spec::Unix; |
---|
[17034] | 6 | |
---|
| 7 | $VERSION = '1.1'; |
---|
| 8 | |
---|
[14544] | 9 | @ISA = qw(File::Spec::Unix); |
---|
| 10 | |
---|
| 11 | sub devnull { |
---|
| 12 | return "/dev/nul"; |
---|
| 13 | } |
---|
| 14 | |
---|
| 15 | sub case_tolerant { |
---|
| 16 | return 1; |
---|
| 17 | } |
---|
| 18 | |
---|
| 19 | sub file_name_is_absolute { |
---|
| 20 | my ($self,$file) = @_; |
---|
| 21 | return scalar($file =~ m{^([a-z]:)?[\\/]}is); |
---|
| 22 | } |
---|
| 23 | |
---|
| 24 | sub path { |
---|
| 25 | my $path = $ENV{PATH}; |
---|
| 26 | $path =~ s:\\:/:g; |
---|
| 27 | my @path = split(';',$path); |
---|
| 28 | foreach (@path) { $_ = '.' if $_ eq '' } |
---|
| 29 | return @path; |
---|
| 30 | } |
---|
| 31 | |
---|
| 32 | my $tmpdir; |
---|
| 33 | sub tmpdir { |
---|
| 34 | return $tmpdir if defined $tmpdir; |
---|
| 35 | my $self = shift; |
---|
| 36 | foreach (@ENV{qw(TMPDIR TEMP TMP)}, qw(/tmp /)) { |
---|
| 37 | next unless defined && -d; |
---|
| 38 | $tmpdir = $_; |
---|
| 39 | last; |
---|
| 40 | } |
---|
| 41 | $tmpdir = '' unless defined $tmpdir; |
---|
| 42 | $tmpdir =~ s:\\:/:g; |
---|
| 43 | $tmpdir = $self->canonpath($tmpdir); |
---|
| 44 | return $tmpdir; |
---|
| 45 | } |
---|
| 46 | |
---|
| 47 | 1; |
---|
| 48 | __END__ |
---|
| 49 | |
---|
| 50 | =head1 NAME |
---|
| 51 | |
---|
| 52 | File::Spec::OS2 - methods for OS/2 file specs |
---|
| 53 | |
---|
| 54 | =head1 SYNOPSIS |
---|
| 55 | |
---|
| 56 | require File::Spec::OS2; # Done internally by File::Spec if needed |
---|
| 57 | |
---|
| 58 | =head1 DESCRIPTION |
---|
| 59 | |
---|
| 60 | See File::Spec::Unix for a documentation of the methods provided |
---|
| 61 | there. This package overrides the implementation of these methods, not |
---|
| 62 | the semantics. |
---|
Note: See
TracBrowser
for help on using the repository browser.