I want to be able to launch and capture the output produced by a console application
such as a compiler or whatever it is ran from my program in BCB. Is this hard to do?
Can't I just ShellExecute the executable and then redirect the output to a temporary text file and then just read the text file? If yes, I know in Unix, if I want to re-direct the output you would use the < redirection symbol for example "ls -l < output.txt" What is the symbol for DOS to redirect the output to a text file?
I can achive this via code and then just read the file.
By the way, I am not a Unix/Linux guy, I just know this from Uni...and reading Unix books.
Anyway I have searched the Borland Developer Network but all the samples I found there are written for Delphi (something which I don't have or know too well) and JBuilder too but I was unable to find examples for C++ Builder, the tool that I use.
May someone please show me or hint me how to achieve this? I know I have been asking a lot and you have been of great help so I thank you all for that and so that you know, I do have a book but many specific things like this are not documented.
Question
ford_fpv
Hi,
I want to be able to launch and capture the output produced by a console application
such as a compiler or whatever it is ran from my program in BCB. Is this hard to do?
Can't I just ShellExecute the executable and then redirect the output to a temporary text file and then just read the text file? If yes, I know in Unix, if I want to re-direct the output you would use the < redirection symbol for example "ls -l < output.txt" What is the symbol for DOS to redirect the output to a text file?
I can achive this via code and then just read the file.
By the way, I am not a Unix/Linux guy, I just know this from Uni...and reading Unix books.
Anyway I have searched the Borland Developer Network but all the samples I found there are written for Delphi (something which I don't have or know too well) and JBuilder too but I was unable to find examples for C++ Builder, the tool that I use.
May someone please show me or hint me how to achieve this? I know I have been asking a lot and you have been of great help so I thank you all for that and so that you know, I do have a book but many specific things like this are not documented.
Link to comment
https://www.neowin.net/forum/topic/464884-how-to-capture-the-output-of-a-console-app-in-bcb/Share on other sites
4 answers to this question
Recommended Posts