How to Execute SCP command to transfer files to a target machine
-
@jsulm its printing true for both
qDebug() << connect(&proc, SIGNAL(readyReadStandardError()), this, SLOT(readOutput())); qDebug() << connect(&proc, SIGNAL(readyReadStandardOutput()), this, SLOT(readOutput()));``` qDebug() in readOutput() is not printing any thing.
@moyin This is your problem:
proc.startDetached(command,params) ;
startDetached() is a static method! So you start your process, but it is not managed by the proc instance! Use start() instead:
proc.start(command, params);
-
@moyin This is your problem:
proc.startDetached(command,params) ;
startDetached() is a static method! So you start your process, but it is not managed by the proc instance! Use start() instead:
proc.start(command, params);
-
@moyin
I'm lost as to where you're at.But at least at one point you were told to use
QProcess::startDetached()
rather thanQProcess:start()
. I believe (untested by me, as usual, could be putting my neck on the line...) that you cannot properly redirect process input/output and/or get signals for input/output if you run the child process detached...? -
@moyin
I'm lost as to where you're at.But at least at one point you were told to use
QProcess::startDetached()
rather thanQProcess:start()
. I believe (untested by me, as usual, could be putting my neck on the line...) that you cannot properly redirect process input/output and/or get signals for input/output if you run the child process detached...? -
@JNBarchan This was already mentioned, but @moyin says that it isn't working even after changing to start().
There most be still something in the code, that's why I asked for the current code.@jsulm
OK, as long he is not tryingstartDetached
that's good...FWIW, I happen to just be working on my own Dialog which spawns a sub-process (
QProcess::start()
), gets its output via signals, and copies it into scrolling text widget, and it's all working fine for me. As one would expect!Purely BTW, given the command is an
scp
whose job is to copy the files, I wonder just what stdout/stderr output he is expecting? Has he informed us whether it's just the output that's missing/empty, or whether the whole command is not running in any case?? -
This post is deleted!