1. Capturing from Windows CLI output

Hi all!

Does anybody know of a simple way for capturing the output of a command line
(i.e. a system command or a program) that is executed from within a program
through system() or system_exec().

Of course you can redirect the output to a temp file, then open it, read it, do
what you have to do, then close and eventually delete the temp file. But my
feeling is that it is rather inelegant and on a more practical ground there are
drawbacks:

- your program might be run under conditions where it is not permitted to create
a file;
- whatever the fancy name you choose for the temp file you'll never be
absolutely sure you won't inadvertently overwrite an existing one;
- ...

Have a nice day!

Henri Goffin

new topic     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu