use strict;
$VERSION = '1.2';
sub devnull {
}
sub case_tolerant {
return 1;
}
sub file_name_is_absolute {
}
sub path {
$path =~ s:\\:/:g;
return @path;
}
sub _cwd {
# In OS/2 the "require Cwd" is unnecessary bloat.
}
my $tmpdir;
sub tmpdir {
my $self = shift;
'/tmp',
'/' );
}
sub catdir {
my $self = shift;
my @args = @_;
foreach (@args) {
tr[\\][/];
# append a backslash to each argument unless it has one there
$_ .= "/" unless m{/$};
}
}
sub canonpath {
$path =~ s/^([a-z]:)/\l$1/s;
$path =~ s|\\|/|g;
$path =~ s|^(\./)+(?=[^/])||s; # ./xx -> xx
$path =~ s|/\Z(?!\n)||
unless $path =~ m#^([a-z]:)?/\Z(?!\n)#si;# xx/ -> xx
$path =~ s{^/\.\.$}{/}; # /.. -> /
return $path;
}
sub splitpath {
if ( $nofile ) {
$path =~
m{^( (?:[a-zA-Z]:|(?:\\\\|//)[^\\/]+[\\/][^\\/]+)? )
(.*)
}xs;
$volume = $1;
$directory = $2;
}
else {
$path =~
m{^ ( (?: [a-zA-Z]: |
(?:\\\\|//)[^\\/]+[\\/][^\\/]+
)?
)
( (?:.*[\\\\/](?:\.\.?\Z(?!\n))?)? )
(.*)
}xs;
$volume = $1;
$directory = $2;
$file = $3;
}
}
sub splitdir {
my ($self,$directories) = @_ ;
split m|[\\/]|, $directories, -1;
}
sub catpath {
# If it's UNC, make sure the glue separator is there, reusing
# whatever separator is first in the $volume
$volume .= $1
if ( $volume =~ m@^([\\/])[\\/][^\\/]+[\\/][^\\/]+\Z(?!\n)@s &&
$directory =~ m@^[^\\/]@s
) ;
# If the volume is not just A:, make sure the glue separator is
# there, reusing whatever separator is first in the $volume if possible.
$volume =~ m@[^\\/]\Z(?!\n)@ &&
$file =~ m@[^\\/]@
) {
$volume =~ m@([\\/])@ ;
}
return $volume ;
}
sub abs2rel {
# Clean up $path
} else {
}
# Figure out the effective $base and clean it up.
} else {
}
# Split up paths
# Now, remove all leading components that are the same
while ( @pathchunks &&
@basechunks &&
) {
shift @pathchunks ;
shift @basechunks ;
}
# No need to catdir, we know these are well formed.
# $base_directories now contains the directories the resulting relative
# path must ascend out of before it can descend to $path_directory. So,
# replace all names with $parentDir
#FA Need to replace between backslashes...
$base_directories =~ s|[^\\/]+|..|g ;
# Glue the two together, using a separator if necessary, and preventing an
# empty result.
#FA Must check that new directories are not empty.
$path_directories = "$base_directories/$path_directories" ;
} else {
$path_directories = "$base_directories$path_directories" ;
}
) ;
}
sub rel2abs {
}
}
else {
}
my ( $path_directories, $path_file ) =
my ( $base_volume, $base_directories ) =
) ;
}
}
1;
=head1 NAME
File::Spec::OS2 - methods for OS/2 file specs
=head1 SYNOPSIS
require File::Spec::OS2; # Done internally by File::Spec if needed
=head1 DESCRIPTION
See L<File::Spec> and L<File::Spec::Unix>. This package overrides the
implementation of these methods, not the semantics.
Amongst the changes made for OS/2 are...
=over 4
=item tmpdir
Modifies the list of places temp directory information is looked for.
$ENV{TMPDIR}
$ENV{TEMP}
$ENV{TMP}
/tmp
/
=item splitpath
Volumes can be drive letters or UNC sharenames (\\server\share).
=back
=cut