Redirect cmdline app output to a blitz app?

BlitzMax Forums/BlitzMax Programming/Redirect cmdline app output to a blitz app?

Any way to pipe output from a command line app to blitzmax app?

I'm making a console/terminal app and I need to execute another non-blitzmax
app and get it's output. I was looking in the stdio for any pipe info, but see
nothing but input and print.

Does anyone have any solutions that do not use Win32 api calls? Looking for
a solution that will work on any supported blitzmax platform.

(as a last resort I can of course pipe it to a text file and then read that in, but
that takes more time than a direct pipe to my app)

Thanks for any help or info,
-Garrett

Doesn't Skid's PUB.FreeProcess do that. An example (from memory):
Rem
Example of FreeProcess for Garrett
EndRem

Import Pub.FreeProcess

Global myProcess:TProcess = TProcess.Create("stdioapp.exe")

While (myProcess <> Null) And myProcess.Status()

Print myProcess.pipe.readline$()

Wend

myProcess.Terminate

As you probably realise, the above code should print out any data from the process's IO stream until there is no more data to read. Then it terminates the process.

This module is used by the MaxIDE to read data from the Blitz Compiler, so it cross-platform compatible. However, there is little documentation regarding it so I relied mostly on trial + error.

That's right.... I did take a look at that before, but the lack of documentation
shut me down. :-(

Global myProcess:TProcess = TProcess.Create("stdioapp.exe")

I get the following error: Compile Error: Missing function parameter 'flags'

Any clue as to what flags(params) Create("app") is expecting?

Thanks a bunch Seb,
-Garrett

but the lack of documentation shut me down
Most commonly posted Bmax comment. (Even more than where is Max3d)

Most commonly posted Bmax comment. (Even more than where is Max3d)

Now... Now..... I wasn't trying to start anything here by that ya know! ;-)

-Garrett

Sorry, you can use either 0 or "HIDECONSOLE" depending on your desired effect.