[Bio] / FigKernelPackages / DocUtils.pm Repository:
ViewVC logotype

Diff of /FigKernelPackages/DocUtils.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.9, Sun Jul 23 17:47:27 2006 UTC revision 1.10, Wed Jul 26 14:47:46 2006 UTC
# Line 435  Line 435 
435    
436  =head3 CheckFile  =head3 CheckFile
437    
438  C<< my $updated = DocUtils::CheckFile($inFile, $outDirectory, $suffix); >>  C<< my $updated = DocUtils::CheckFile($inFile, $outDirectory, $suffix, $chgFlag); >>
439    
440  This method compares the modification date of a specified file against the  This method compares the modification date of a specified file against the
441  date of a similarly-named file in the specified output directory. It  date of a similarly-named file in the specified output directory. It
# Line 458  Line 458 
458  If specified, a suffix to be added to the input file name to create the  If specified, a suffix to be added to the input file name to create the
459  output file name.  output file name.
460    
461    =item chgFlag (optional)
462    
463    If specified, the suffix will replace the input file name's suffix instead of being
464    appended.
465    
466  =back  =back
467    
468  =cut  =cut
469    
470  sub CheckFile {  sub CheckFile {
471      # Get the parameters.      # Get the parameters.
472      my ($inFile, $outDirectory, $suffix) = @_;      my ($inFile, $outDirectory, $suffix, $chgFlag) = @_;
473      # Create the return variable.      # Create the return variable.
474      my $retVal = 1;      my $retVal = 1;
475      # Get the name of the output file.      # Get the name of the output file.
476      my ($fileTitle, $inDirectory) = fileparse($inFile);      my ($fileTitle, $inDirectory) = fileparse($inFile);
477      my $outFileName = "$outDirectory/$fileTitle";      my $outFileName = "$outDirectory/$fileTitle";
478      if ($suffix) {      if ($suffix) {
479            if ($chgFlag) {
480                $outFileName =~ s/\.[^.]+$/$suffix/;
481            } else {
482          $outFileName .= $suffix;          $outFileName .= $suffix;
483      }      }
484        }
485      # Check to see if the output file exists.      # Check to see if the output file exists.
486      if (-e $outFileName) {      if (-e $outFileName) {
487          # Get the input and output modify times.          # Get the input and output modify times.

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3