Skip to content

Instantly share code, notes, and snippets.

@earl
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save earl/19a07f515e5e9a720615 to your computer and use it in GitHub Desktop.
Save earl/19a07f515e5e9a720615 to your computer and use it in GitHub Desktop.
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