PDA

View Full Version : QProcess



bashamehboob
31st March 2008, 04:46
Hi ALL,

I need to lauch a process remotely.For this ,Should i go about like this.


system("rsh -n remotehost");

if(USE_64BIT)
{
qDebug()<<"64bit==on";
list = (QStringList()<<"--config-file"<<configFile<<"--config-wizard"<<"TRUE"<<"--use-64bit");
qDebug()<< list;
}

else
{
qDebug()<<"64bit not on";
list = (QStringList()<<"--config-file"<<configFile<<"--config-wizard"<<"TRUE"<<);
}

proc = new QProcess(this);
proc->setReadChannel(QProcess::StandardError);
proc->start(home,list,QIODevice::ReadOnly);

am I doing wrong any where . Please help me.

regards,

wysota
31st March 2008, 05:51
What is the contents of "home"?

bashamehboob
31st March 2008, 14:50
Hi,

contents of home is a TOOl :)

like this


strcpy(home, getenv("SYPHOME"));
strcat(home, "/bin/sypTool");

when iam connecting to remote system like this


system("rsh -n remotehost");

it is not working:(.

should i go about opening a shell from the QProcess connect to remote from this :confused:.

regards,
basha.

wysota
31st March 2008, 15:21
But system() is blocking... It won't work that way. You have to call rsh from within QProcess and pass it arguments through the command line or its standard input stream.