#2580 Trying to Capture Out Put Stream from a Process

JohnNuccio Thu 8 Dec 2016

using util

      class ipconfig
         const Str commands := "ipconfig";

    Void main(){
  proc := Process()
                proc.command = Str[commands]
                proc.in = Env.cur().in
  error := proc.err
  //OutStream? err := Env.cur().err
  test := proc.in.readAllLines


How do I capture the result?

SlimerDude Thu 8 Dec 2016

Hi John,

It looks like you're mixing up your inputs and outputs. You want to set and capture the output for the process, like this:

buf := Buf()
Process() {
    command = Str["ipconfig"]
    out = buf.out 
outStr := buf.flip.readAllStr

JohnNuccio Thu 8 Dec 2016

Thanks SlimerDude, this worked perfectly.

Login or Signup to reply.