Changeset 17668

Show
Ignore:
Timestamp:
04.11.2008 06:44:19 (11 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

Files:
1 modified

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