Running a command line program with stdin and stdout

Dar Scott dsc at swcp.com
Sat Dec 21 19:26:01 EST 2002


I have a problem.  I have a program that takes lots of data in via stdin 
and then based on all that data, it produces an output on stdout and 
quits.  I want to be able to use this from a Revolution stack and even a 
standalone.  I am currently trying "open process for binary update".

Here is the problem.  (Well, _a_ problem.)

The way the program knows that it has all the input is that it reaches 
EOF, that is, it reads until the input is closed by the source.  After 
that it creates the output, writes it to stdout, and quits.  This is 
common; it is the way the sort program works on Windows systems.  But:  
If I close the process opened for update, then I cannot read the output.

I imagine I can redirect these through files and use shell, but I'd 
rather not do that.  Is there a solution that does not involve saving to 
files?

Dar Scott




More information about the Use-livecode mailing list