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 #1701 is a reply to message #1699] Tue, 14 March 2006 10:43 Go to previous messageGo to previous message
gprentice is currently offline  gprentice
Messages: 260
Registered: November 2005
Location: New Zealand
Experienced Member
wilho wrote on Tue, 14 March 2006 20:53

I suppose that miriek foresaw my intention not to create real terminal emulator but cmd.exe -wrapper.

If I redirect streams between myprocess/cmd-subprocess, is there a flow-control-alike mechanism - meaning do my input get lost if subprocess is not able to read it immediately?



As far as I can tell, the mechanism by which characters appear in the input stream (e.g. cin or stdin) is compiler, application and OS dependent but there's usually at least a small buffer either in the OS or the application or both (see setbuf()). I do not know whether an application asks the OS for a single character at a time or a "line" at a time or whether it's an event loop style "push" operation as in Win32 GUI apps, however there's no flow control provided by C/C++ runtime or the operating system, so an application that needs to have character input suspended or slowed at any time has to provide it's own flow control.

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: Sat May 04 20:06:10 CEST 2024

Total time taken to generate the page: 0.02601 seconds