(use posix) (define (pipe cmd str) (receive (in out pid) (process cmd) (display str out) (close-output-port out) (print (read-all in)) (close-input-port in))) (pipe "cat" "foo") ;; 4.7.0, 4.7.2 ;; ------------ ;; $ csi -s test.scm ;; foo ;; ;; 4.7.3, 4.7.4 & git ;; ------------------ ;; $ csi -s test.scm ;; Error: (process) cannot read - Resource temporarily unavailable ;; 4 ;; "/bin/bash" ;; ;; Call history: ;; ;; [pipe] (##core#lambda (in out pid) (display str out ) (close-output-port out) (print (read-all in)) (close-i...... ;; [pipe] (##core#begin (display str out) (close-outpu t-port out) (print (read-all in)) (close-input-port in)) ;; [pipe] (display str out) ;; [pipe] (close-output-port out) ;; [pipe] (##core#begin (print (read-all in)) (close-i nput-port in)) ;; [pipe] (print (read-all in)) ;; [pipe] (read-all in) ;; [pipe] (close-input-port in) ;; (pipe "cat" "foo") ;; (pipe "cat" "foo") ;; [pipe] (##sys#call-with-values (##core#lambda () (process c md)) (##core#lambda (in out pid) (display str out... ;; [pipe] (process cmd) ;; [pipe] (display str out) ;; [pipe] (close-output-port out) ;; [pipe] (print (read-all in)) ;; [pipe] (read-all in) <--