How to redirect BMK compiler messages

BlitzMax Forums/BlitzMax Programming/How to redirect BMK compiler messages

Alessandro(Posted 2006) [#1]
Hello,

I noticed a strange thing:

if I try to invoke a command like this (command-line, Ms Windows XP SP2):

bmk.exe makeapp -a runthisscript.bmx >output.txt

I will get the results in output.txt.
The strange thing is if the compiler find an error, the error message is printed-out to console, and not in the file!!!

Do you know how I can solve this problem?

Alessandro


TomToad(Posted 2006) [#2]
try bmk.exe makeapp -a runthisscript.bmx >output.txt 2<&1


Qube(Posted 2006) [#3]
Sounds like the StdErr (error) is not piped through the StdOut (output). I'm not sure there is anything you can do from the console.

I've been doing this recently in Delphi for the IDE I'm writing which covers all Blitz languages. Max console output is much improved over previous Blitz stuff as you can write your own debugger(almost).

If you're programming something involving BMK.exe then have a look at the MaxIDE code as it'll tell you what you need to know.

*edit* even if you get it to display the error message to a text file then the next problem will be when you do the same thing for a debug.exe version you'll end up with ~> everywhere :)


Alessandro(Posted 2006) [#4]
<<Sounds like the StdErr (error) is not piped through the StdOut (output). I'm not sure there is anything you can do from the console.>>

Great! I was so busy that I forgot to implement redirection to StdErr!

Thank you for the suggestion!!!

(I did not redirect to a file, but I'm using CreateProcess() and anonimous pipes to get, in real time, everything comes out from the compiler, and I will show (then parse) in an editor inside the RAD development environment I'm creating: RADicchio!