summaryrefslogtreecommitdiff
path: root/dist
diff options
context:
space:
mode:
authorAndy Broad <andy@broad.ology.org.uk>2015-08-13 21:17:44 -0400
committerJarkko Hietaniemi <jhi@iki.fi>2015-09-05 11:12:47 -0400
commit36f667896230b68cc65817f9eee2401887f8f60c (patch)
treecd1809d602c52dcde98d5c986052c949d131c101 /dist
parent027b7a30840ad5b6f0f2e583ed0b60ecc3206465 (diff)
downloadperl-36f667896230b68cc65817f9eee2401887f8f60c.tar.gz
amigaos4: dist/PathTools/lib/File/Spec: add AmigaOS.pm
Diffstat (limited to 'dist')
-rw-r--r--dist/PathTools/lib/File/Spec.pm3
-rw-r--r--dist/PathTools/lib/File/Spec/AmigaOS.pm61
2 files changed, 63 insertions, 1 deletions
diff --git a/dist/PathTools/lib/File/Spec.pm b/dist/PathTools/lib/File/Spec.pm
index 2f35526555..31e886bacb 100644
--- a/dist/PathTools/lib/File/Spec.pm
+++ b/dist/PathTools/lib/File/Spec.pm
@@ -14,7 +14,8 @@ my %module = (MacOS => 'Mac',
NetWare => 'Win32', # Yes, File::Spec::Win32 works on NetWare.
symbian => 'Win32', # Yes, File::Spec::Win32 works on symbian.
dos => 'OS2', # Yes, File::Spec::OS2 works on DJGPP.
- cygwin => 'Cygwin');
+ cygwin => 'Cygwin',
+ amigaos => 'AmigaOS');
my $module = $module{$^O} || 'Unix';
diff --git a/dist/PathTools/lib/File/Spec/AmigaOS.pm b/dist/PathTools/lib/File/Spec/AmigaOS.pm
new file mode 100644
index 0000000000..86c55c3dee
--- /dev/null
+++ b/dist/PathTools/lib/File/Spec/AmigaOS.pm
@@ -0,0 +1,61 @@
+package File::Spec::AmigaOS;
+
+use strict;
+use vars qw(@ISA $VERSION);
+require File::Spec::Unix;
+
+$VERSION = '3.57';
+$VERSION =~ tr/_//;
+
+@ISA = qw(File::Spec::Unix);
+
+=head1 NAME
+
+File::Spec::AmigaOS - File::Spec for AmigaOS
+
+=head1 SYNOPSIS
+
+ require File::Spec::AmigaOS; # Done automatically by File::Spec if needed
+
+=head1 DESCRIPTION
+
+Methods for manipulating file specifications.
+
+=head1 METHODS
+
+=over 2
+
+=item tmpdir
+
+Returns $ENV{TMPDIR} or if that is unset, "/t".
+
+=cut
+
+my $tmpdir;
+sub tmpdir {
+ return $tmpdir if defined $tmpdir;
+ $tmpdir = $_[0]->_tmpdir( $ENV{TMPDIR}, "/t" );
+}
+
+=item file_name_is_absolute
+
+Returns true if there's a colon in the file name,
+or if it begins with a slash.
+
+=cut
+
+sub file_name_is_absolute {
+ my ($self, $file) = @_;
+
+ # Not 100% robust as a "/" must not preceded a ":"
+ # but this cannot happen in a well formed path.
+ return $file =~ m{^/|:}s;
+}
+
+=back
+
+All the other methods are from L<File::Spec::Unix>.
+
+=cut
+
+1;