|
// retoor <retoor@molodetz.nl>
|
|
// nontest
|
|
|
|
import "pexpect" for Spawn
|
|
import "timer" for Timer
|
|
|
|
System.print("1. Creating child")
|
|
var child = Spawn.new("echo hello")
|
|
|
|
System.print("2. Sleeping 200ms")
|
|
Timer.sleep(200)
|
|
|
|
System.print("3. Buffer: [%(child.buffer)]")
|
|
System.print("4. isalive: %(child.isalive)")
|
|
|
|
System.print("5. Calling readNonblocking")
|
|
var data = child.readNonblocking(100, 1)
|
|
System.print("6. Data: [%(data)]")
|
|
|
|
System.print("7. Buffer after read: [%(child.buffer)]")
|
|
System.print("8. Closing")
|
|
child.close()
|
|
System.print("Done")
|