Changeset 17065

Show
Ignore:
Timestamp:
28.08.2008 16:43:31 (11 years ago)
Author:
mdewsnip
Message:

Added check that the GDBM .txt.gz file actually exists before trying to unzip it, to prevent confusing messages in the error.txt file.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • gsdl/trunk/common-src/src/lib/gdbmclass.cpp

    r16895 r17065  
    103103 
    104104      text_t txtgz_filename = filename_root + ".txt.gz"; 
    105  
    106       text_t cmd = "gzip --decompress --to-stdout \"" + txtgz_filename + "\""; 
    107       cmd += " | txt2db \"" + filename + "\""; 
    108  
    109       int rv = gsdl_system(cmd, true, cerr); 
    110       if (rv != 0) { 
    111     cerr << "Tried to run command \""<<cmd<<"\", but it failed\n"; 
     105      if (file_exists(txtgz_filename)) 
     106      { 
     107    text_t cmd = "gzip --decompress --to-stdout \"" + txtgz_filename + "\""; 
     108    cmd += " | txt2db \"" + filename + "\""; 
     109 
     110    int rv = gsdl_system(cmd, true, cerr); 
     111    if (rv != 0) { 
     112      cerr << "Tried to run command \""<<cmd<<"\", but it failed\n"; 
     113    } 
    112114      } 
    113115    }