Changeset 31763

Show
Ignore:
Timestamp:
29.06.2017 18:18:06 (5 months ago)
Author:
ak19
Message:

Fixing somethings before attempting to refactor tmp_area_convert_file

Files:
1 modified

Legend:

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

    r31762 r31763  
    183183    my ($output_ext, $input_filename, $textref) = @_; 
    184184 
    185     my $plugin_name = $self->{'plugin_type'}; # inherited from BaseImporter 
    186  
    187185    #### COPIED FROM ConvertBinaryFile::tmp_area_convert_file() 
    188186    my $outhandle = $self->{'outhandle'}; 
     
    252250    # running under windows 
    253251    if ($ENV{'GSDLOS'} =~ /^windows$/i) { 
    254         $output_dirname = $tmp_dirname . "\\$utf8_tailname\\" . $utf8_tailname; 
     252        $output_dirname = $tmp_dirname . "\\$utf8_tailname\\"; 
    255253    } else { 
    256         $output_dirname = $tmp_dirname . "\/$utf8_tailname\/" . $utf8_tailname; 
     254        $output_dirname = $tmp_dirname . "\/$utf8_tailname\/"; 
    257255    } 
    258     $output_filename .= ".item"; 
     256    $output_filename = $output_dirname . $utf8_tailname . ".item"; 
    259257    } else { 
    260258    $output_filename =~ s/$lc_suffix$/.$output_type/; 
     
    270268    # If running the command returns 0, let's assume success and so the act of running the command 
    271269    # should produce either a text file or output to stdout. 
     270 
     271    my $plugin_name = $self->{'plugin_type'}; # inherited from BaseImporter 
    272272 
    273273    my $cmd = $self->{'exec_cmd'}; 
     
    315315 
    316316 
    317     if(defined $output_dirname && -d $output_dirname) { 
     317    if(defined $output_dirname && ! -d $output_dirname) { 
    318318    print $outhandle "$plugin_name Conversion error: Output directory $output_dirname doesn't exist\n"; 
    319319    return ""; 
    320320    } 
    321     elsif (!-e $output_filename) { 
     321    elsif (! -f $output_filename) { 
    322322    print $outhandle "$plugin_name Conversion error: Output file $output_filename doesn't exist\n"; 
    323323    return "";