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

List:       kde-devel
Subject:    Re: KProcess: explicitly pull from stderr
From:       Thomas Friedrichsmeier <thomas.friedrichsmeier () ruhr-uni-bochum ! de>
Date:       2005-11-18 10:45:43
Message-ID: 200511181145.43361.thomas.friedrichsmeier () ruhr-uni-bochum ! de
[Download RAW message or body]

> I'm not sure you're right about "flushing". On the writer's side, stderr is
> usually not buffered so data arrives to kernel immediately. I don't think
> that the kernel buffer corresponding to pipe is "flushed". Reading from the
> other end of the pipe should get the data it contains, immediately.

You may well be right about this. I don't know for sure.

> Well, QApplication::processEvent accepts a "time" argument. Will that work?

Probably most of the time it should. However, note that as far as I know, if 
there are no events to process at the moment, processEvents will return 
immediately, regardless of the time argument. It's just a maximum time.

Well, I had an idea for a (very) dirty hack:
1) When you detect the prompt in stdout, don't finish right away, but:
2) Deliberately run an invalid command in gdb (like "alskdflaskj")
3) Wait until you receive 'Undefined command: "alskdflaskj".  Try "help".' in 
stderr. Strip that error from any "true" error output.
This way you'd be sure you've received all stdout and all stderr pending.

If all else fails, this should probably work.

Regards
Thomas
 
>> Visit http://mail.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