Changeset 27757

Show
Ignore:
Timestamp:
04.07.2013 17:09:30 (6 years ago)
Author:
ak19
Message:

Using FileUtils? subroutines instead of deprecated calls to util package

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/bin/script/pdftohtml.pl

    r24600 r27757  
    3939use parsargv; 
    4040use util; 
     41use FileUtils; 
    4142use Cwd; 
    4243use File::Basename; 
     
    108109 
    109110    # formulate the command 
    110     my $cmd = &util::filename_cat($ENV{'GSDLHOME'}, "bin", $ENV{'GSDLOS'}, "pdftohtml"); 
     111    my $cmd = &FileUtils::filenameConcatenate($ENV{'GSDLHOME'}, "bin", $ENV{'GSDLOS'}, "pdftohtml"); 
    111112 
    112113    # don't include path on windows (to avoid having to play about 
     
    127128    print STDERR "pdftohtml error for $input_filename $!\n"; 
    128129    # leave these for gsConvert.pl... 
    129     #&util::rm("$output_filestem.text") if (-e "$output_filestem.text"); 
    130     #&util::rm("$output_filestem.err") if (-e "$output_filestem.err"); 
     130    #&FileUtils::removeFiles("$output_filestem.text") if (-e "$output_filestem.text"); 
     131    #&FileUtils::removeFiles("$output_filestem.err") if (-e "$output_filestem.err"); 
    131132    return 1; 
    132133    } 
     
    139140# words, screwing up indexing and searching. 
    140141# At the same time, check that our .html file has some textual content. 
    141     &util::mv("$output_filestem.html","$output_filestem.html.tmp"); 
     142    &FileUtils::moveFiles("$output_filestem.html","$output_filestem.html.tmp"); 
    142143    $!=0; 
    143144    open INFILE, "$output_filestem.html.tmp" || 
     
    203204    close INFILE; 
    204205    close OUTFILE; 
    205     &util::rm("$output_filestem.html.tmp"); 
     206    &FileUtils::removeFiles("$output_filestem.html.tmp"); 
    206207 
    207208    # Need to convert images from PPM format to PNG format 
     
    217218    } 
    218219    close IMAGES; 
    219     &util::rm("${directory}image.log") if (-e "${directory}image.log"); 
     220    &FileUtils::removeFiles("${directory}image.log") if (-e "${directory}image.log"); 
    220221 
    221222    } 
     
    227228    for $image (@images) { 
    228229        chomp($image); 
    229         &util::rm("${directory}$image"); 
     230        &FileUtils::removeFiles("${directory}$image"); 
    230231    } 
    231232    return 1; 
     
    257258        } 
    258259    } 
    259     &util::rm($image); 
     260    &FileUtils::removeFiles($image); 
    260261    } 
    261262