Open/Write to/Read from Process

mendelss at baymoon.com mendelss at baymoon.com
Thu Nov 13 16:29:47 EST 2003


Hey, I'm new to Revolution and need some quick guidance on what may be a very 
straightforward matter.

I've created a simple front-end interface designed to call and write some input 
to a free-standing program on my machine.  The external program is designed to 
be executed from and receive input from the command line.  I'm currently 
working with Revolution 2.0 on OS X, but the product will eventually need to 
run on some Unix machines as well.

>From the brief Revolution documentation on the subject, it looks like I would 
use "open process", "write to process", and "read from process" to interact 
with the program from Revolution.  Alternately, perhaps I would use "shell()" 
to replicate a Unix-based call from the command line, though past usergroup 
postings seem to use that command exclusively in a Windows context.  

However, the "open process" and "write to process" commands don't seem to do 
anything when I call them (if I open a shell and hit "ps", there's no process 
running), and the "read from process" command registers an error and won't 
compile.  Using "put shell(commandLineThatStartsProgram) into myShellOutput" 
crashes Revolution when it tries to run.  Am I way off base with these 
attempts, or just doing something slightly wrong?  If I could simply get the 
following to work, it would be a useful start:

         put "/thePath/ProgramName" into nameAndPath
         open process nameAndPath
         put “WhateverMyInputIs” into myInput
         write myInput to process nameAndPath

Thanks,

Nathan




More information about the use-livecode mailing list