Changeset 12902


Ignore:
Timestamp:
2006-09-28T16:01:05+12:00 (18 years ago)
Author:
kjdon
Message:

tidied up saveRecords a bit. SRWDownload now uses filename_cat instead of foreward slashes.

Location:
trunk/gsdl/perllib/downloaders
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/perllib/downloaders/SRWDownload.pm

    r12586 r12902  
    137137    $host =~ s/http:\/\///;
    138138    $strOutputDir  =~ s/"//g; #"
    139     my $strFileURL = "$strOutputDir/$host/$strFileName.xml";
    140   
     139    my $strOutputFile = &util::filename_cat($strOutputDir,$host,"$strFileName.xml");
     140 
    141141    # prepare subdirectory for record (if needed)
    142142
    143     my ($strSubDirPath,$unused) = $self->dirFileSplit($strFileURL);
     143    my ($strSubDirPath,$unused) = $self->dirFileSplit($strOutputFile);
    144144    &util::mk_all_dir($strSubDirPath);
    145145
    146     my $ds = &util::get_dirsep();
    147  
    148     print STDERR "Saving records to \"$strFileURL\"\n";
     146   print STDERR "Saving records to \"$strOutputFile\"\n";
    149147
    150148    # save record
    151     open (ZOUT,">$strFileURL")
     149    open (ZOUT,">$strOutputFile")
    152150    || die "Unable to save oai metadata record: $!\n";
    153151    print ZOUT $strRecords;
  • trunk/gsdl/perllib/downloaders/Z3950Download.pm

    r12587 r12902  
    239239    $strOutputDir  =~ s/"//g; #"
    240240
    241     my $strFileURL = "$strOutputDir/$self->{'host'}/$strFileName.marc";
     241    my $strOutputFile = &util::filename_cat($strOutputDir,$self->{'host'},"$strFileName.marc");
     242     # prepare subdirectory for record (if needed)
     243    my ($strSubDirPath,$unused) = $self->dirFileSplit($strOutputFile);
     244 
     245    &util::mk_all_dir($strSubDirPath);
    242246 
    243     # prepare subdirectory for record (if needed)
    244     my ($strSubDirPath,$unused) = $self->dirFileSplit($strFileURL);
    245  
    246     &util::mk_all_dir($strSubDirPath);
    247 
    248     my $ds = &util::get_dirsep();
    249     my $strOutputFile = &util::filename_cat($strOutputDir,$self->{'host'},"$strFileName.marc");
    250    
    251247    print STDERR "Saving records to \"$strOutputFile\"\n";
    252248
Note: See TracChangeset for help on using the changeset viewer.