-
-
Save earl/19a07f515e5e9a720615 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
REBOL [] | |
p: make port! subprocess://foobar ;; Would of course also need more ways to specify the subprocess to be created. | |
p/awake: func [event] [ | |
switch event/type [ | |
input [ | |
write event/port {Data sent to FOOBAR's stdin.} | |
] | |
output [ | |
print [{Data received from FOOBAR's stdout:} copy event/port/data] | |
] | |
error [ | |
print [{Data received from FOOBAR's stderr:} copy event/port/data] | |
] | |
exit [ | |
print [{FOOBAR exited with return code:} event/port/state] | |
return true | |
] | |
] | |
false | |
] | |
open p |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment