[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: KProcess help needed
From:       Waldo Bastian <bastian () kde ! org>
Date:       2001-03-23 21:20:36
[Download RAW message or body]

On Friday 23 March 2001 09:39, Joe Theriault wrote:
> On Friday 23 March 2001 03:00 am, Waldo Bastian wrote:
> > On Thursday 22 March 2001 21:59, Joe Theriault wrote:
> > > I've been banging my head against a wall for days with a simple
> > > kprocess problem  I've been trying to get output to stderr sent the
> > > parent process.
> > >
> > > These are selections of what I would figure would be all the relevant
> > > code, I figure I missed something silly or there is a common pitfall
> > > I'm not aware of.
> > >
> > > KProcess client;
> > >
> > > connect(&client, SIGNAL(receivedStdout(KProcess *, char *, int)), this,
> > > SLOT(transferCompleted(KProcess *, char *, int)));
> >
> > Try connecting receivedStderr instead of receivedStdout.
>
> The code I sent along that time was after a desperate try to see if I
> actually wanted stdout instead of stderr.  In other words I've tried using
> recievedStderr.

Heh, don't ask for something "silly" then :-) You might want to play around a 
bit with kdelibs/kdecore/tests/kprocesstest.cpp, you can compile it by typing 
"make kprocesstest" in that directory. E.g. replace the line with:
	p3 << "ls" << "-l";
with your program and see what happens.

You might want to add some etra checking of the return value of 'start(...)' 
and listen for processExited(...) and check exitStatus() when that happens.

Cheers,
Waldo
-- 
bastian@kde.org | SuSE Labs KDE Developer | bastian@suse.com
 
>> Visit http://master.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic