Hi,
There's a small problem I can't really solve so far regarding the console output of batch files.
I wrote a DBP program that at one point creates a batch-file that calls the Scala interpreter (Scala is a language based on Java, but that doesn't really matter) with a file name used as argument, so this batch file leads to a windows console opening up and executing the command "scala <file>".
What I'd like to do now is to immediately print the output, that usually shows up in the console, in my DBP program. In theory this is pretty simple using standard redirection: "scala MyProgram >log.txt" for instance.
However, this method doesn't work the way I want it to, given that I can't access log.txt until the scala program terminated - but considering that it may run for quite a while, it would be of great advantage if I could access the output in real time.
Oddly enough, this is possible manually. I can for instance open the log.txt file while it's being modified with a standard text editor. However, not with DBP, since file exist("log.txt") keeps returning 0/false until the scala program terminates. Which is really kind of weird.
Does anybody have an idea how I could solve this problem?
Thanks in advance,
MrK
Edit: An alternative solution for me would be to redirect the output of "scala <file>" not only to a log-file, but also show it in the console in parallel. Unfortunately, this seems to be impossible in the windows standard console, since the "tee" command that would be used for such a task is not available there, nor is any suitable alternative.
I'm really mad at Scala and Windows right now. Oh yeah, and Dark Basic that keeps thinking an existing file does not exist for some inexplicable reason.