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

List:       kde-core-devel
Subject:    Re: Bug in KProcess?
From:       Waldo Bastian <bastian () kde ! org>
Date:       2002-09-02 18:44:29
[Download RAW message or body]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Monday 02 September 2002 08:47 am, Sebastian Trüg wrote:
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> > #if Sebastian Trueg
> >
> > > Hy,
> > >
> > > it seems to be impossible to pass several Communication flags or'ed
> > > together to the start() method. I get
> > >
> > > no matching function for call to `KProcess::start (KProcess::RunMode,
> > > int)' /opt/kde3/include/kprocess.h:273: candidates are: bool
> > > KProcess::start(KProcess::RunMode = NotifyOnExit,
> > > KProcess::Communication = NoCommunication)
> > >
> > > for every combination.
> > > But I need to pass the NoRead flag in conjunction with AllOutput. I
> > > there a trick or is this impossible?
> >
> > Try a cast:
> >
> > process->start
> > (
> >   KProcess::NotifyOnExit,
> >   KProcess::Communication(KProcess::NoRead | KProcess::AllOutput)
> > );
>
> Thanx. That worked. But I still get no usable output. Always length -1!
> ???!!!
> Any idea?

You pass "NoRead" so you have to do the reading yourself and update the length 
according to what read() returns.

I guess you not want to pass NoRead and instead let KProcess do the reading 
for you. You must connect to the other receivedStdout() signal in that case.

Cheers,
Waldo
- -- 
bastian@kde.org  |   SuSE Labs KDE Developer  |  bastian@suse.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE9c7GNN4pvrENfboIRAltDAJ4urmNhPOkDSi/RxiOQVC1NMl5jJgCdEiWd
zeUiNuP2cNzfhLq8SU+JgTo=
=OKXD
-----END PGP SIGNATURE-----

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

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