X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=scripts%2Ffiles%2Ffilename_helper.pl;h=50b71edc7a626675923fc7f6ffcacc9c92830a9c;hb=1ca24b12c472cb24a21ba3efc43824bc21af264a;hp=b4218166bdace61371b05ba1ca7c56fcc3e0fcb3;hpb=b4b11bb8121b10d0e645d1b12b7b22b38faa9c3b;p=feisty_meow.git diff --git a/scripts/files/filename_helper.pl b/scripts/files/filename_helper.pl index b4218166..50b71edc 100644 --- a/scripts/files/filename_helper.pl +++ b/scripts/files/filename_helper.pl @@ -408,7 +408,8 @@ return; } local *DIR; - opendir DIR, $dir or die "opendir $dir: $!"; + # if we can't open the dir, just skip to the next one. + opendir DIR, $dir or next; while ($_ = readdir DIR) { next if /^\.{1,2}$/; my $path = "$dir/$_"; @@ -428,7 +429,8 @@ sub find_directories { my $dir; foreach $dir (@_) { local *DIR; - opendir DIR, $dir or die "opendir $dir: $!"; + # if we can't open the dir, just skip to the next one. + opendir DIR, $dir or next; while ($_ = readdir DIR) { # skip if it's current or parent dir. next if /^\.{1,2}$/; @@ -455,7 +457,8 @@ sub find_files { next; } local *DIR; - opendir DIR, $dir or die "opendir $dir: $!"; + # if we can't open the dir, just skip to the next one. + opendir DIR, $dir or next; while ($_ = readdir DIR) { # skip if it's current or parent dir. next if /^\.{1,2}$/;