iswaryasenthilkumar
15th June 2015, 05:31
i want to execute the script file in qt,i used Qprocess to execute my script file.i getting error "premission denied",so i used chmod methos to execute my script file in qt,after that i execute my qt,,again i getting same error,please help me to recover thsi problem:(
Thanks in advance:o
my code below:
int Widget::call()
{
if(directory1.exists(folder))
{
qDebug()<<"directory exist";
directory1.cd(folder);
QProcess opendir;
QStringList arguments;
QString program = folder;// "/home/digital"
arguments <<"./samp.sh"; //"textfile"
opendir.start(program, arguments);
opendir.setProcessChannelMode(QProcess::ForwardedC hannels);
status = opendir.waitForFinished();
if (!status)
{
qDebug()<< opendir.errorString()<<"error";
return FAIL;
}
else
{
return SUCCESS;
}
}
else
{
qDebug()<<"diretory not exist";
}
}
Thanks in advance:o
my code below:
int Widget::call()
{
if(directory1.exists(folder))
{
qDebug()<<"directory exist";
directory1.cd(folder);
QProcess opendir;
QStringList arguments;
QString program = folder;// "/home/digital"
arguments <<"./samp.sh"; //"textfile"
opendir.start(program, arguments);
opendir.setProcessChannelMode(QProcess::ForwardedC hannels);
status = opendir.waitForFinished();
if (!status)
{
qDebug()<< opendir.errorString()<<"error";
return FAIL;
}
else
{
return SUCCESS;
}
}
else
{
qDebug()<<"diretory not exist";
}
}