Changeset 17065


Ignore:
Timestamp:
2008-08-28T16:43:31+12:00 (16 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.

File:
1 edited

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    }
Note: See TracChangeset for help on using the changeset viewer.