Changeset 29379


Ignore:
Timestamp:
10/20/14 10:08:50 (6 years ago)
Author:
kjdon
Message:

implementing statsfile option which is used by the depositor

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/inexport.pm

    r29370 r29379  
    254254    $out->autoflush(1);
    255255    $self->{'out'} = $out;
     256
     257    my $statsfile = $self->{'statsfile'};
     258    if ($statsfile !~ /^(STDERR|STDOUT)$/i) {
     259    open (STATSFILE, ">$statsfile") ||
     260        (&gsprintf(STDERR, "{common.cannot_open_output_file}: $!\n", $statsfile) && die);
     261    $statsfile = 'inexport::STATSFILE';
     262    $self->{'close_stats'} = 1;
     263    }
     264    $statsfile->autoflush(1);
     265    $self->{'statsfile'} = $statsfile;
    256266
    257267    # @ARGV should be only one item, the name of the collection
     
    10371047  my $out           = $self->{'out'};
    10381048  my $faillogname   = $self->{'faillogname'};
     1049  my $statsfile     = $self->{'statsfile'};
    10391050  my $gli           = $self->{'gli'};
    10401051
     
    10441055  &gsprintf($out, "*********************************************\n");
    10451056
    1046   &plugin::write_stats($pluginfo, 'STDERR', $faillogname, $gli);
     1057  &plugin::write_stats($pluginfo, $statsfile, $faillogname, $gli);
    10471058}
    10481059# generate_statistics()
     
    10571068  close OUT if $self->{'close_out'};
    10581069  close FAILLOG if $self->{'close_faillog'};
     1070  close STATSFILE if $self->{'close_statsfile'};
    10591071}
    10601072# deinit()
Note: See TracChangeset for help on using the changeset viewer.