Bug in KProcess?

Waldo Bastian bastian at kde.org
Mon Sep 2 19:44:29 BST 2002


-----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 at kde.org  |   SuSE Labs KDE Developer  |  bastian at 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-----





More information about the kde-core-devel mailing list