- Timestamp:
- 2013-05-24T09:38:05+12:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gs2-extensions/parallel-building/trunk/src/perllib/FileUtils.pm
r27384 r27421 40 40 my $debug = 0; 41 41 42 # /** @function _callFunction($driver_name, $function_name, ...) 43 # * Make a function call to a dynamically loaded database driver. 44 # * @param $driver_name - The name of the file protocol driver to load 45 # * @param $function_name - The function within the driver to call 46 # * @param <rest> - The parameters to be passed to the function called 47 # */ 42 ## @function _callFunction($driver_name, $function_name, ...) 43 # 44 # Make a function call to a dynamically loaded database driver. 45 # @param $driver_name - The name of the file protocol driver to load 46 # @param $function_name - The function within the driver to call 47 # @param <rest> - The parameters to be passed to the function called 48 # 48 49 sub _callFunction 49 50 { … … 71 72 return $result; 72 73 } 73 # /** callFunction() **/ 74 75 # /** @function _prettyPrint($type, ...) 76 # * Print a debugging message to STDERR constructed from the <rest> based 77 # * upon the type. 78 # * @param type - If 0, output the start of a function with a listing of its 79 # * parameters. If 1, output the result of a function. 2 is 80 # * used for function errors. Default to simply printing what- 81 # * ever else is in <rest> 82 # */ 74 ## callFunction() 75 76 ## @function _prettyPrint() 77 # 78 # Print a debugging message to STDERR constructed from the <rest> based upon 79 # the type. 80 # @param type - If 0, output the start of a function with a listing of its 81 # parameters. If 1, output the result of a function. 2 is 82 # used for function errors. Default to simply printing what- 83 # ever else is in <rest> 84 # 83 85 sub _prettyPrint 84 86 { … … 144 146 print STDERR "[" . time() . "] " . $message . "\n"; 145 147 } 146 # /** _prettyPrint($type, $function, $message) **/148 ## _prettyPrint() 147 149 148 150 # /** @function _determineDriver() … … 384 386 sub filePutContents 385 387 { 386 my ($path, $str) = @_; 388 my $path = shift(@_); 389 my $str = shift(@_); 387 390 my $driver = &FileUtils::_determineDriver($path); 388 391 my $fh; … … 414 417 sub canRead 415 418 { 416 my ($path) = @_;417 my $driver = &FileUtils::_determineDriver($path); 418 return &FileUtils::_callFunction($driver, ' fileTest', $path, '-R');419 my $path = shift(@_); 420 my $driver = &FileUtils::_determineDriver($path); 421 return &FileUtils::_callFunction($driver, 'canRead', $path, @_); 419 422 } 420 423 ## canRead() … … 487 490 # /** fileSize() **/ 488 491 489 # /**490 # */492 ## @function hardLink() 493 # 491 494 sub hardLink 492 495 { … … 512 515 } 513 516 } 514 # /** hardLink() **/ 517 ## hardLink() 518 515 519 516 520 ## @function isFilenameAbolsute() … … 525 529 } 526 530 ## isFilenameAbsolute() 531 527 532 528 533 ## @function isSymbolicLink()
Note:
See TracChangeset
for help on using the changeset viewer.