1

How do I capture the stream that is being created for the Process? See the limited Fantom documentation for Process: http://fantom.org/doc/sys/Process

class Ipconfig {

   Void main() {
     proc := Process()
     proc.command = Str["ipconfig"]
     proc.in = Env.cur().in
     proc.run
     proc.join
     test := proc.in.readAllLines
     echo(test)
   }
 }
Steve Eynon
  • 4,979
  • 2
  • 30
  • 48
nuccio
  • 316
  • 6
  • 17

1 Answers1

1

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 
}.run.join

outStr := buf.flip.readAllStr
echo(outStr)
Steve Eynon
  • 4,979
  • 2
  • 30
  • 48