Changeset 30351 for gs2-extensions

Show
Ignore:
Timestamp:
16.12.2015 15:43:01 (4 years ago)
Author:
jmt12
Message:

Restructured readDirectory to not die if directory isn't readable

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • gs2-extensions/parallel-building/trunk/src/perllib/FileUtils/LocalFS.pm

    r27682 r30351  
    345345{ 
    346346  my $path = shift(@_); 
    347   opendir(DH, $path) or &FileUtils::printError('Failed to open directory for reading: ' . $path, 1); 
    348   my @files = readdir(DH); 
    349   close(DH); 
    350   return \@files; 
     347  my $rvalue; 
     348  if (opendir(DH, $path)) 
     349  { 
     350      my @files = readdir(DH); 
     351      close(DH); 
     352      $rvalue = \@files; 
     353  } 
     354  return $rvalue; 
    351355} 
    352356# /** readDirectory() **/