U++ framework
Do not panic. Ask here before giving up.

Home » Developing U++ » U++ Developers corner » evaluate command line (parse line by line processed command to create backup log)
evaluate command line [message #58686] Thu, 21 July 2022 22:04 Go to previous message
BetoValle is currently offline  BetoValle
Messages: 210
Registered: September 2020
Location: Brasil Valinhos SP
Experienced Member

I found this code below and tested it successfully. But my intention is to evaluate the contents of each line that the mysqldump program generates. How to do this? Could someone help me with an example?
Grateful!


CONSOLE_APP_MAIN  
{
	std::stringstream ss;
	std::string pathOfCommand ="C:\\Program Files (x86)\\MariaDB 10.1\\bin\\mysqldump.exe";
	std::string params=" -u mylogin --password=mypass --verbose --extended-insert=FALSE databaseName > ";
	std::string pathOfInputFile="C:\\TEMP\\file1.sql";

        // some code to set values for paths and solves the filename space problem
	ss << "\"";                             // command opening quote
	ss << "\"" << pathOfCommand   << "\" "; // Quoted binary (could have spaces)
	ss << " " << params << " ";  		// Quoted input (could have spaces)
	ss << "\"" << pathOfInputFile << "\"";  // Quoted input (could have spaces)
	ss << "\"";                             // command closing quote  

        Cout() << "seeing how the command turned out:" << ss.str() << EOL;

        int i;
        i=system( ss.str().c_str() );
        Cout() <<"backup result: " << i << EOL;    
    
}

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: log file in Oracle8
Next Topic: Windows 11 toolbar and menu issues
Goto Forum:
  


Current Time: Mon Nov 23 05:34:33 GMT+1 2026

Total time taken to generate the page: 0.00662 seconds