Changeset 23943

Show
Ignore:
Timestamp:
21.04.2011 15:13:22 (9 years ago)
Author:
ak19
Message:

Xiaofeng encountered a problem with opening a file for writing in archives (a problem creating the earliestDatestamp file). Trying another way to exit on error.

Files:
1 modified

Legend:

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

    r23939 r23943  
    552552    my $metadata = {}; 
    553553     
    554     # gobal blocking pass may set up some metadata 
     554    # global blocking pass may set up some metadata 
    555555    &plugin::file_block_read($pluginfo, $importdir, "", $block_hash, $metadata, $gli); 
    556556     
     
    716716    # oailastmodified and oailastmodifieddate 
    717717    my $earliestDatestampFile = &util::filename_cat($archivedir, "earliestDatestamp"); 
    718     if (!-f $earliestDatestampFile) { 
     718    if (!-f $earliestDatestampFile && -d $archivedir) { 
    719719    my $current_time_in_seconds = time; # in seconds 
    720     open(FOUT, ">$earliestDatestampFile") || die "{common.cannot_open} $earliestDatestampFile: $!\n"; 
    721     #    (&gsprintf(STDERR, "{common.cannot_open}: $!\n", $earliestDatestampFile) && die); 
     720    open(FOUT, ">$earliestDatestampFile") ||  
     721        (&gsprintf(STDERR, "{common.cannot_open}: $!\n", $earliestDatestampFile) && die); 
     722    # die "{common.cannot_open} $earliestDatestampFile: $!\n"; 
    722723    print FOUT $current_time_in_seconds; 
    723724    close(FOUT);