=head1 REVISION
-Current $VERSION is 1.04.
+Current $VERSION is 1.0401.
=cut
use strict;
use vars qw( $VERSION @ISA @EXPORT );
-$VERSION = "1.04";
+$VERSION = "1.0401";
@ISA = qw( Exporter );
@EXPORT = qw( mkpath rmtree );
$paths = [$paths] unless ref $paths;
my(@created,$path);
foreach $path (@$paths) {
+ $path .= '/' if $^O eq 'os2' and $path =~ /^\w:$/; # feature of CRT
next if -d $path;
# Logic wants Unix paths, so go with the flow.
$path = VMS::Filespec::unixify($path) if $Is_VMS;
my $parent = File::Basename::dirname($path);
- push(@created,mkpath($parent, $verbose, $mode)) unless (-d $parent);
+ # Allow for creation of new logical filesystems under VMS
+ if (not $Is_VMS or $parent !~ m:/[^/]+/000000/?:) {
+ push(@created,mkpath($parent, $verbose, $mode)) unless (-d $parent);
+ }
print "mkdir $path\n" if $verbose;
unless (mkdir($path,$mode)) {
# allow for another process to have created it meanwhile
if $force_writeable;
print "unlink $root\n" if $verbose;
# delete all versions under VMS
- while (-e $root || -l $root) {
- if (unlink $root) {
- ++$count;
- }
- else {
+ for (;;) {
+ unless (unlink $root) {
carp "Can't unlink file $root: $!";
if ($force_writeable) {
chmod $rp, $root
or carp("and can't restore permissions to "
. sprintf("0%o",$rp) . "\n");
}
+ last;
}
+ ++$count;
+ last unless $Is_VMS && lstat $root;
}
}
}