Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Extra libraries, Code snippets, applications etc. » C++ language problems and code snippets » capturing stdout/err/in of subprocess
Re: capturing stdout/err/in of subprocess [message #1754 is a reply to message #1753] Fri, 17 March 2006 23:25 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
gprentice wrote on Fri, 17 March 2006 17:11


Quote:


There are no pipe functions I am aware of (in both Linux and Win32) that would indicate the "waiting for the stdin" (or, in fact "subprocess is blocked because of empty stdin") state.

Standard input behaves (from master process point of view) just like output file.

Then again, I might have missed something.



Why do you need to know the process is waiting for input? If you send characters to stdin the OS is going to buffer them until the process asks for them. From what I can tell, if you were to try and hold off sending a character until the previous character had been processed, the application would run too slowly because of all the context switching. It seems to me it's the applications responsibility to keep up with the input if it knows there's a lot of it. Maybe you could try PeekConsoleInput if you have the stdin handle, to see if stdin is "empty" ?

Graeme



Unfortunatly, PeekConsoleInput seems to deal with existing Win32 console - not something would help us as we are here trying to implement ours...

Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: New EH handling in MinGW
Next Topic: DLL and U++ type
Goto Forum:
  


Current Time: Sat May 04 11:44:30 CEST 2024

Total time taken to generate the page: 0.02927 seconds