Hi,
I was writing a small piece of code to execute some system commands.
I'm using Debian, i changed GDM3 to allow root access (no security issues needed in this case) and the code is:
void criarWindowsDialog::on_pushButton_2_clicked()
{
ui->commandTextEdit->append("Processo iniciado ...");
//comando 1 - limpar a pasta
comando = "rm";
args.clear();
args<<"-f"<<"/home/srp/imagens/windows/*";
fullCommand = comando;
for(int i = 0; i < args.count(); i++)
fullCommand += " " + args.at(i);
processo.
start(comando,args,
QIODevice::ReadOnly);
processo.waitForFinished();
stdOut = processo.readAllStandardOutput();
stdError = processo.readAllStandardError();
ui->commandTextEdit->append(fullCommand);
ui->stdOutTextEdit->append(stdOut);
ui->stdErrorTextEdit->append(stdError);
void criarWindowsDialog::on_pushButton_2_clicked()
{
ui->commandTextEdit->append("Processo iniciado ...");
QProcess processo;
QString comando;
QStringList args;
QString fullCommand;
QString stdOut;
QString stdError;
//comando 1 - limpar a pasta
comando = "rm";
args.clear();
args<<"-f"<<"/home/srp/imagens/windows/*";
fullCommand = comando;
for(int i = 0; i < args.count(); i++)
fullCommand += " " + args.at(i);
processo.start(comando,args,QIODevice::ReadOnly);
processo.waitForFinished();
stdOut = processo.readAllStandardOutput();
stdError = processo.readAllStandardError();
ui->commandTextEdit->append(fullCommand);
ui->stdOutTextEdit->append(stdOut);
ui->stdErrorTextEdit->append(stdError);
To copy to clipboard, switch view to plain text mode
When i check the message from "stdError" i get:
Failed to open terminal.TERM environment variable needs set.
Failed to open terminal.TERM environment variable needs set.
To copy to clipboard, switch view to plain text mode
This is a simple command to delete files inside a folder.
Is the problem related to configuration in debian?
Bookmarks