Show
Ignore:
Timestamp:
14.06.2017 22:19:39 (2 years ago)
Author:
ak19
Message:

Don't know how to stop the flashing DOS windows on GS2 when JDBM is used, since I don't know how to replace the popen calls in jdbmnaiveclass.cpp that get the process' output with variants that don't cause flashing DOS prompts. But replacing 2 occurrences of system() calls in jdbmnaiveclass.cpp with gsdltools.cpp's gsdl_system() calls, which hide any DOS prompts on windows. Compiles okay on Windows, and nothing appears to have broken. Doesn't resolve the other instances making calls to JDBM and which use popen calls instead of system().

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/common-src/src/lib/jdbmnaiveclass.cpp

    r24729 r31738  
    137137  delete [] openfile_cstr; 
    138138 
    139   int status = system(cmd); 
     139  //int status = system(cmd); // avoid flashing windows 
     140  int status = gsdl_system(cmd, true, *logout); // true for synchronous call: wait for process to end 
    140141  if (status != 0 ) { 
    141142    (*logout) << "jdbmnaiveclass: failed to run cmd: " << cmd << endl; 
     
    296297  delete [] openfile_cstr; 
    297298 
    298   int status = system(cmd); 
     299  //int status = system(cmd); // causes flashing DOS prompt windows 
     300  // https://stackoverflow.com/questions/1597289/hide-console-in-c-system-function-win 
     301  int status = gsdl_system(cmd, true, *logout); // passing false makes it a synchronous call 
    299302  if (status != 0) { 
    300303    (*logout) << "jdbmnaiveclass: failed to run cmd:"  
     
    308311} 
    309312 
     313 
     314