+ $opendirs->{$dir} = $dh if $n < 0;
+ }
+ if ($path =~ /full\z/) {
+ foreach my $dir (@{$self->{mdir}}) {
+ next if $opendirs->{$dir}; # already in progress
+ my $ok = opendir(my $dh, $dir);
+ unless ($ok) {
+ warn "failed to open $dir: $!\n";
+ next;
+ }
+ my $n = $max;
+ while (my $fn = readdir($dh)) {
+ _try_path($self, "$dir/$fn");
+ last if --$n < 0;
+ }
+ $opendirs->{$dir} = $dh if $n < 0;
+ }
+ }
+ if (keys %$opendirs) { # do we have more work to do?
+ trigger_scan($self, 'cont');
+ } else {
+ _done_for_now($self);