Unsolved QProcess::start: Process is already running
-
Hi,
I am using qprocess in my application.
while start qprocess,I got warning QProcess::start: Process is already running.Regards,
Rashmi -
@Rashmi
Can you show me what have you tried? -
QString program = "/home/cosense/test1.sh";
m_myprocess = new QProcess();
qDebug() << m_myprocess->state() ;
m_myprocess->start(program);
qDebug() << "state"<< m_myprocess->state() ;My observations are before start qprocess , state was running by checking state code using qdeug.
-
what is inside test1.sh?
If it never finishes/exits it will run for ever. -
#!/bin/sh
ls -tr /home/cosense/database/Clinical_data > /home/cosense/sorted1.txt
echo "me"
echo "done"Here, script sort the files from folder and write into text file.
I ran script seperately.It works fine.It doesnt run forever -
@Rashmi
Ok seems fine.
You can use
http://doc.qt.io/qt-5/qprocess.html#waitForFinishedto be sure its finished before calling state() ;