with-process-stream waits for process exit
							parent
							
								
									d779ce0a78
								
							
						
					
					
						commit
						e9b5a6b9d3
					
				| 
						 | 
				
			
			@ -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 } }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue