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
my code below:
int Widget::call()
{
if(directory1.exists(folder))
{
qDebug()<<"directory exist";
directory1.cd(folder);
QString program
= folder;
// "/home/digital" arguments <<"./samp.sh"; //"textfile"
opendir.start(program, arguments);
opendir.
setProcessChannelMode(QProcess::ForwardedChannels);
status = opendir.waitForFinished();
if (!status)
{
qDebug()<< opendir.errorString()<<"error";
return FAIL;
}
else
{
return SUCCESS;
}
}
else
{
qDebug()<<"diretory not exist";
}
}
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::ForwardedChannels);
status = opendir.waitForFinished();
if (!status)
{
qDebug()<< opendir.errorString()<<"error";
return FAIL;
}
else
{
return SUCCESS;
}
}
else
{
qDebug()<<"diretory not exist";
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks