with-process-stream waits for process exit

db4
Slava Pestov 2008-02-04 19:38:19 -06:00
parent d779ce0a78
commit e9b5a6b9d3
2 changed files with 4 additions and 4 deletions

View File

@ -146,8 +146,8 @@ HELP: with-process-stream
{ $values
{ "desc" "a launch descriptor" }
{ "quot" quotation }
{ "process" process } }
{ $description "Calls " { $snippet "quot" } " in a dynamic scope where " { $link stdio } " is rebound to a " { $link process-stream } ". When the quotation returns, the " { $link process } " instance is output." } ;
{ "status" "an exit code" } }
{ $description "Calls " { $snippet "quot" } " in a dynamic scope where " { $link stdio } " is rebound to a " { $link process-stream } ". After the quotation returns, waits for the process to end and outputs the exit code." } ;
HELP: wait-for-process
{ $values { "process" process } { "status" integer } }

View File

@ -98,10 +98,10 @@ TUPLE: process-stream process ;
{ set-delegate set-process-stream-process }
process-stream construct ;
: with-process-stream ( desc quot -- process )
: with-process-stream ( desc quot -- status )
swap <process-stream>
[ swap with-stream ] keep
process-stream-process ; inline
process-stream-process wait-for-process ; inline
: notify-exit ( status process -- )
[ set-process-status ] keep