Ignore:
Timestamp:
2013-05-29T20:41:13+12:00 (11 years ago)
Author:
ak19
Message:

Using the recommended FileUtils.pm methods in place of the deprecated utils.pm methods.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/plugins/ConvertBinaryFile.pm

    r26893 r27509  
    4545no strict 'subs';
    4646use util;
     47use FileUtils;
    4748
    4849
     
    108109    my $colplugname = undef;
    109110    if (defined $ENV{'GSDLCOLLECTDIR'}) {
    110         $colplugname = &util::filename_cat($ENV{'GSDLCOLLECTDIR'},
     111        $colplugname = &FileUtils::filenameConcatenate($ENV{'GSDLCOLLECTDIR'},
    111112                           "perllib","plugins",
    112113                           $plugin_package);
    113114    }
    114115
    115     my $mainplugname = &util::filename_cat($ENV{'GSDLHOME'},
     116    my $mainplugname = &FileUtils::filenameConcatenate($ENV{'GSDLHOME'},
    116117                           "perllib","plugins",
    117118                           $plugin_package);
     
    255256
    256257    my $lc_suffix = lc($suffix);
    257     my $tmp_filename = &util::filename_cat($tmp_dirname, "$utf8_tailname$lc_suffix");
     258    my $tmp_filename = &FileUtils::filenameConcatenate($tmp_dirname, "$utf8_tailname$lc_suffix");
    258259   
    259260    # If gsdl is remote, we're given relative path to input file, of the form import/tailname.suffix
     
    261262    # the input_filename is the absolute path, see http://perldoc.perl.org/File/Spec.html
    262263    my $ensure_path_absolute = 1; # true
    263     &util::soft_link($input_filename, $tmp_filename, $ensure_path_absolute);
     264    &FileUtils::softLink($input_filename, $tmp_filename, $ensure_path_absolute);
    264265    my $verbosity = $self->{'verbosity'};
    265266    if ($verbosity > 0) {
     
    267268    }
    268269
    269     my $errlog = &util::filename_cat($tmp_dirname, "err.log");
     270    my $errlog = &FileUtils::filenameConcatenate($tmp_dirname, "err.log");
    270271   
    271272    # Execute the conversion command and get the type of the result,
     
    290291   
    291292    # remove symbolic link to original file
    292     &util::rm($tmp_filename);
     293    &FileUtils::removeFiles($tmp_filename);
    293294   
    294295    # Check STDERR here
     
    307308        close ERRLOG;
    308309    }
    309     &util::rm("$errlog") if (-e "$errlog");
     310    &FileUtils::removeFiles("$errlog") if (-e "$errlog");
    310311    return "";
    311312    }
     
    364365    }
    365366    else {
    366         &util::mv("${conv_filename}.tmp", $conv_filename);
     367        &FileUtils::moveFiles("${conv_filename}.tmp", $conv_filename);
    367368    }   
    368369    }
     
    460461    # associate original file with doc object
    461462    my $cursection = $doc_obj->get_top_section();
    462     my $filename = &util::filename_cat($base_dir, $file);
     463    my $filename = &FileUtils::filenameConcatenate($base_dir, $file);
    463464    my $assocfilename = "doc.$doc_ext";
    464465    if ($self->{'keep_original_filename'} == 1) {
     
    489490     if (defined $tmp_dir && -d $tmp_dir) {
    490491     ##print STDERR "**** Suppressing clean up of tmp dir\n";
    491      &util::rm_r($tmp_dir);
     492     &FileUtils::removeFilesRecursive($tmp_dir);
    492493     $self->{'tmp_dir'} = undef;
    493494     }
Note: See TracChangeset for help on using the changeset viewer.