Capturing from Windows CLI output
- Posted by Henri.Goffin at sbs.be May 17, 2001
- 404 views
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