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 #1753 is a reply to message #1746] Fri, 17 March 2006 23:11 Go to previous messageGo to previous message
gprentice is currently offline  gprentice
Messages: 260
Registered: November 2005
Location: New Zealand
Experienced Member

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
 
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: Tue May 14 03:12:02 CEST 2024

Total time taken to generate the page: 0.02168 seconds