Board index » Visual Studio » How can I capture the output of a system() call

How can I capture the output of a system() call

Visual Studio324
Hi. I'd like to capture the output of a call to system() and store it in a

string. I believe this involves redirecting stdin but I'm not sure how to go

about doing that.



Any help is appreciated.



Isaac


-
 

Re:How can I capture the output of a system() call

"Isaac Raway" <isaac@blueapples.org>wrote in message

Quote
Hi. I'd like to capture the output of a call to system() and store it

in a

string. I believe this involves redirecting stdin but I'm not sure how

to go

about doing that.



See KB Article Q190351 "HOWTO: Spawn Console Processes with Redirected

Standard Handles"

--

With best wishes,

Igor Tandetnik



"For every complex problem, there is a solution that is simple, neat,

and wrong." H.L. Mencken





-

Re:How can I capture the output of a system() call

This looks like what I want, but the example is somewhat complex...is there

no simpler way to do this? I remember doing something like this in VB based

on a KB article a few months ago, and it didn't take nearly that much code.



"Igor Tandetnik" <itandetnik@mvps.org>wrote in message

Quote
"Isaac Raway" <isaac@blueapples.org>wrote in message

news:%23Jk66FkRDHA.2248@TK2MSFTNGP12.phx.gbl...

>Hi. I'd like to capture the output of a call to system() and store it

in a

>string. I believe this involves redirecting stdin but I'm not sure how

to go

>about doing that.



See KB Article Q190351 "HOWTO: Spawn Console Processes with Redirected

Standard Handles"

--

With best wishes,

Igor Tandetnik



"For every complex problem, there is a solution that is simple, neat,

and wrong." H.L. Mencken









-

Re:How can I capture the output of a system() call

See if you can use the _popen() API.



--

Cheers

Check Abdoul [ VC++ MVP ]

-----------------------------------



"Isaac Raway" <isaac@blueapples.org>wrote in message

Quote
Hi. I'd like to capture the output of a call to system() and store it in a

string. I believe this involves redirecting stdin but I'm not sure how to

go

about doing that.



Any help is appreciated.



Isaac









-