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 #1760 is a reply to message #1755] Sat, 18 March 2006 01:01 Go to previous messageGo to previous message
lundman is currently offline  lundman
Messages: 175
Registered: March 2006
Location: Tokyo
Experienced Member

I must agree I am not quite following why you need to know if your pipe-child is listening or not. You'll know if the child has gone away (EPIPE). The whole line buffering and echo is a tty/terminal feature which you can disable with ioctl(), that is quite trivial.

But if you create pipes to your child you need not worry about linemode/echo as it is direct without the tty/terminal layer.

You can check the number of bytes buffered in the pipe, set the low and high water marks, and maybe even the process flags. But why?

In LiON, to make sure to be portable, and allow for the pipe to be in select() non-blocking loops (HANDLES can't be in select(), and nonblocking polling is hard if you want to work on Win95/98/Me), I had to create read/write threads to translate between HANDLE and SOCKET.

But it works well, the same code will spawn processes on Unix, as Windows, and talk to it. I had to implement fork() and execv() for Windows though.

 
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 10:25:43 CEST 2024

Total time taken to generate the page: 0.02212 seconds