Changeset 27501


Ignore:
Timestamp:
05/28/13 13:47:46 (8 years ago)
Author:
jmt12
Message:

Missed (another) old style file open that instead needs to go through FileUtils::openFileHandle() - this time for the doomed RSS file (which won't work properly in the HDFS collections due to the current lack of proper file append)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/plugouts/BasePlugout.pm

    r27500 r27501  
    522522            # only if opening new file
    523523        my $output_dir = $self->get_output_dir();
    524         &util::mk_all_dir ($output_dir) unless -e $output_dir;
     524        &FileUtils::makeAllDirectories($output_dir) unless -e $output_dir;
    525525        my $doc_file = &FileUtils::filenameConcatenate($output_dir, $doc_dir, "doc.xml");
    526526        my $short_doc_file = &FileUtils::filenameConcatenate($doc_dir, "doc.xml");
     
    661661    return if (!defined $output_dir);
    662662
    663     &util::mk_all_dir ($output_dir) unless -e $output_dir;
     663    &FileUtils::makeAllDirectories($output_dir) unless -e $output_dir;
    664664     
    665665    my $working_dir = &FileUtils::filenameConcatenate($output_dir, $doc_dir);
    666     &util::mk_all_dir ($working_dir) unless -e $working_dir;
     666    &FileUtils::makeAllDirectories($working_dir) unless -e $working_dir;
    667667
    668668    my @assoc_files = ();
     
    837837
    838838    my $rss_filename = &FileUtils::filenameConcatenate($output_dir,"rss-items.rdf");
    839     if (open(RSSOUT,">>$rss_filename")) {
    840         print RSSOUT "<item>\n";
    841         print RSSOUT "   <title>$dc_title</title>\n";
    842         print RSSOUT "   <link>_httpdomain__httpcollection_/document/$oid</link>\n";
    843         print RSSOUT "</item>\n";
    844         close(RSSOUT);
     839        my $rss_fh;
     840    if (&FileUtils::openFileHandle($rss_filename, '>>', \$rss_fh)) {
     841        print $rss_fh "<item>\n";
     842        print $rss_fh "   <title>$dc_title</title>\n";
     843        print $rss_fh "   <link>_httpdomain__httpcollection_/document/$oid</link>\n";
     844        print $rss_fh "</item>\n";
     845        &FileUtils::closeFileHandle($rss_fh);
    845846    }
    846847    else {
Note: See TracChangeset for help on using the changeset viewer.