doubt in by executing script file in qt
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:
Code:
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";
}
}
Re: doubt in by executing script file in qt
What access rights does your script have? Who is the owner of the script?
Re: doubt in by executing script file in qt
i changed my mode chmod oug+rwx samp.sh
Code:
-rwxrwxrwx 1 digital_images digital_images 98 Jun 15 05:26 samp.sh
Re: doubt in by executing script file in qt
Re: doubt in by executing script file in qt
Is /home/digital really the name of your program and you are passing an argument of samp.sh? Your error is because you can't execute a directory. Change your program variable to be the actual program you want to execute (i.e. /bin/sh or /bin/bash, etc).
Re: doubt in by executing script file in qt
Quote:
Originally Posted by
jefftee
Change your program variable to be the actual program you want to execute (i.e. /bin/sh or /bin/bash, etc).
Or the script itself.
Why execute something else if you want to execute samp.sh
Cheers,
_