Changeset 17668 for gsdl/trunk/perllib


Ignore:
Timestamp:
2008-11-04T06:44:19+13:00 (15 years ago)
Author:
kjdon
Message:

added a counter into the filenames for downloaded documents - sometimes thee may be two with the same file extension so we need to distinguish between them

File:
1 edited

Legend:

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

    r17549 r17668  
    291291    my $strMetaTag = $1;
    292292    my $had_valid_url = 0;
    293 
     293    my $count = 1;
    294294    while ($strMetaTag =~ s/<(dc:)?identifier>(.*?)<\/(dc:)?identifier>//is)
    295295    {
     
    396396
    397397        my $download_doc_filename = $oai_rec_filename;
    398         $download_doc_filename =~ s/\.oai$/\.$id_file_ext/;
    399 
     398        my $new_extension = "\-$count\.$id_file_ext";
     399        $count++;
     400        #$download_doc_filename =~ s/\.oai$/\.$id_file_ext/;
     401        $download_doc_filename =~ s/\.oai$/$new_extension/;
    400402        my ($unused,$download_doc_file) = $self->dirFileSplit($download_doc_filename);
    401403
Note: See TracChangeset for help on using the changeset viewer.