summaryrefslogtreecommitdiff
path: root/lib/File/Path.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/File/Path.pm')
-rw-r--r--lib/File/Path.pm8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/File/Path.pm b/lib/File/Path.pm
index 8d775d52d5..62f3b504bb 100644
--- a/lib/File/Path.pm
+++ b/lib/File/Path.pm
@@ -131,9 +131,13 @@ sub rmtree {
$root =~ s#/$##;
if (not -l $root and -d _) {
opendir(D,$root);
- ($root = VMS::Filespec::unixify($root)) =~ s#\.dir$## if $Is_VMS;
- @files = map("$root/$_", grep $_!~/^\.{1,2}$/, readdir(D));
+ @files = readdir(D);
closedir(D);
+ # Deleting large numbers of files from VMS Files-11 filesystems
+ # is faster if done in reverse ASCIIbetical order
+ @files = reverse @files if $Is_VMS;
+ ($root = VMS::Filespec::unixify($root)) =~ s#\.dir$## if $Is_VMS;
+ @files = map("$root/$_", grep $_!~/^\.{1,2}$/,@files);
$count += rmtree(\@files,$verbose,$safe);
if ($safe &&
($Is_VMS ? !&VMS::Filespec::candelete($root) : !-w $root)) {