[REBOL] Re: Command/Pro call interact with external program using STDIO
From: micael:gullmes:telenor:se at: 30-Jan-2003 9:31
if it works, that would be a neat solution!
Unfortenatly I do not have the time to dig into it rigth now,
I have a tight deadline for the project I am working with.
I will work around it in a quick'n'dirty & more CPU/memory consuming way.
I.e. calling the external program multiple times, not a nice solution, but time is my
I hope I get some sparetime to start looking into this ata later stage, but since my
knowledge about ports are limited, it will probably take lots of time.
Fr=E5n: Gabriele Santilli [mailto:[g--santilli--tiscalinet--it]]
Skickat: den 29 januari 2003 21:45
Till: Gullmes Micael
=C4mne: [REBOL] Re: Command/Pro call interact with external program using
On Wednesday, January 29, 2003, 2:41:12 PM, you wrote:
GM> ;-------Fantasy example 1
GM> stdio: open/call %"format a:"
GM> if equal? copy stdio "Insert new diskette for drive A: and press ENTER when ready..."
GM> insert stdio "Y"
GM> print result: copy stdio
GM> close stdio
GM> ;-------End Fantasy example 1
Actually REBOL allows you to do something very close to that. CALL
allows you to pass a port for the /INPUT and /OUTPUT refinements.
You could write your own port handler to have the functionality
you desire. I cannot guarantee that it will work because I know
there are some problems if the way CALL handles IO redirection,
but in theory it should work. :-)
Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer
Amigan -- AGI L'Aquila -- REB: http://web.tiscali.it/rebol/index.r