0

I'm trying to run the windows shell from my qt program and, from there, run a tftp command ... I'm documenting a bit 'but I do not understand what is wrong. First of all i want to say that the device connected with my computer is correctly responding to plain tftp call. So, i know for sure that the problem is all in this piece of code

Tried Qprocess process; process.start("tftp -i 192.168.2.1 get configINPUT.txt"); With no luck

The i tried

QProcess process;
QString program = "cmd.exe";
QStringList arguments = QStringList();

arguments<< "/C";
arguments<< "tftp";
arguments<< "-i";
arguments<< "192.168.2.1";
arguments<< "get";
arguments<< "configINPUT.txt";
bool ret= process.startDetached(program,arguments);
qDebug() << arguments;
qDebug() << ret;

Ret is returning TRUE but i got no files at all from the device

Tried to call tftp directly too with

 QProcess process;
QString program = "tftp";
QStringList arguments = QStringList();

arguments<< "/C";
arguments<< "-i";
arguments<< "192.168.2.1";
arguments<< "get";
arguments<< "configINPUT.txt";
bool ret= process.startDetached(program,arguments);
qDebug() << arguments;
qDebug() << ret;

Now ret is FALSE too so i think that is the wrong way to make the system call.. Anyone have some hint to spare? Thanks a lot

Nic
  • 163
  • 3
  • 19
  • Please provide a [short, self contained, correct example](http://sscce.org/) that demonstrates the problem. I can get all three of those to work, but that doesn't help you, right? Make sure you post a complete `main.cpp` that begins with `#include `. – Kuba hasn't forgotten Monica May 03 '18 at 17:17
  • In the second case: how do you know that you got no files? You do understand that they will be saved to the folder where your application was built, right? Because that's the folder where Qt Creator starts your application. In general, the folder is arbitrary and you need to choose some folder first! – Kuba hasn't forgotten Monica May 03 '18 at 17:18
  • @Kuba Ober i posted the code i'm using. It's a simple function call on button click. Problem is that i got no error from QProcess::errorOccurred even if nothing has happened – Nic May 04 '18 at 08:15

0 Answers0