|
-
June 28th, 2002, 01:32 PM
#1
Capturing stdout, stderr into a string
Sorry, made an error in the title, hence posting again.
Hi Gurus,
I want to capture the stdout/stderr from a system() command into a string. How would I do this? I know I can capture into a file, but how into a string? Do I have to capture in a file, and then read the file? That sucks!
Kamran
P.S. Only portable solutions please (no MFCs)
-
June 28th, 2002, 06:42 PM
#2
You could try popen instead of system. This will put the output straight into a pipe which you can read directly. On Unix, it is popen, on Windows, it is _popen.
Are you using an OS that supports pipes?
Succinct is verbose for terse
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|