I have a problem, this is my code
QProcess *process = new QProcess(this);
process->setEnvironment(QProcess::systemEnvironment());
process->setStandardErrorFile(getAbsolutePath("logs")+"mylog.log",QIODevice::Append);
process->setProgram(program);
process->setArguments(arguments);
//loop is a QEventLoop
loop.connect(process, SIGNAL(finished(int, QProcess::ExitStatus)),
this, SLOT(finalProcess(int, QProcess::ExitStatus)));
process->start();
qDebug()<<process->program()<<process->arguments();
if(!process->waitForStarted(3600000)) {
myLog.addMessage(process->program()+" "+process->errorString());
}
loop.exec();
process->close();
delete process;
process = NULL;
This code is a function that is called inside a loop and its works but only n times (for example i need do n = 100 but code crash in n=17) until crash with output (process->errorString())
QProcess failed to start: the file name or extension is too long.
Then I changed the path for other more short, I saw how the n will be more higher before crash, I did more QProcess but not all.
I dont understand why I can't do a number of infinites QProcess if I want, always I wait every one of my QProcess with my QEventLoop to finish. Can anyone have the solution?
thank you very much