On Sun, 16 May 2004, Roeland Moors wrote:

> The wrapper didn't work, but I found a solution I just send an extra empty
> command after each command.

this, essentially, how my session library works.  when i send a command i
create a spcial string that looks something like

  __BEGIN__CMD_42__
  __END__CMD_42__

and ask the interpreter (for example sh) to echo the begining string, run the
command, and then echo the end one.  that way i'm guaranteed that the output
stream will look like

(junk)__BEGIN__CMD_42__\n(output from command)__END__CMD_42__\n(junk)


it's then pretty straight forward to parse the output out.  you may want to
look at my session package - if you pulled out the popen3 and replaced with
popen i can't think of any reason it couldn't be made to work on windows.


-a
-- 
===============================================================================
| EMAIL   :: Ara [dot] T [dot] Howard [at] noaa [dot] gov
| PHONE   :: 303.497.6469
| ADDRESS :: E/GC2 325 Broadway, Boulder, CO 80305-3328
| URL     :: http://www.ngdc.noaa.gov/stp/
| TRY     :: for l in ruby perl;do $l -e "print \"\x3a\x2d\x29\x0a\"";done 
===============================================================================