Changeset 30352 for gs2-extensions/parallel-building/trunk/src
- Timestamp:
- 2015-12-16T15:44:15+13:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gs2-extensions/parallel-building/trunk/src/perllib/FileUtils.pm
r30287 r30352 77 77 } 78 78 ## callFunction() 79 80 81 ## @function _hasFunction() 82 # 83 sub _hasFunction 84 { 85 my $driver_name = shift(@_); 86 my $function_name = shift(@_); 87 # Need to look within fileutils directory 88 my $package_name = 'FileUtils::' . $driver_name; 89 # Try to load the requested infodb type 90 if (!&_loadDriver($package_name)) 91 { 92 &printError('Failed to load requested file protocol driver: ' . $package_name, 1); 93 } 94 # Then make call to the newly created package 95 no strict; 96 # Check if the function call exists 97 my $symbol = qualify($function_name, $package_name); 98 return defined &{$symbol}; 99 } 100 ## _hasFunction() 101 79 102 80 103 ## @function _prettyPrint() … … 433 456 $first = 0; 434 457 $dirsofar .= $dirname; 435 next if $dirname =~ /^(|[a-z]:)$/i; 458 next if $dirname =~ /^(|[a-z]+:)$/i; 459 # we can't create some directories (drivers specific) 460 if (&isSpecialDirectory($dirsofar)) { 461 next; 462 } 436 463 if (!&directoryExists($dirsofar)) 437 464 { … … 600 627 } 601 628 ## isHDFS() 629 630 631 ## @function isSpecialDirectory() 632 # 633 sub isSpecialDirectory 634 { 635 my $path = shift(@_); 636 my $driver = &FileUtils::_determineDriver($path); 637 my $result = 0; # not special 638 if (&FileUtils::_hasFunction($driver, 'isSpecialDirectory')) 639 { 640 $result = &FileUtils::_callFunction($driver, 'isSpecialDirectory', $path); 641 } 642 return $result; 643 } 644 ## isSpecialDirectory() 645 602 646 603 647 ## @function isSymbolicLink()
Note:
See TracChangeset
for help on using the changeset viewer.