(use-modules ;; (srfi srfi-180) ;; (ice-9 rdelim) (ice-9 binary-ports) ;; (ice-9 textual-ports) ;; (ice-9 match) (ice-9 popen) ) (define (example-1) ;; Hangs without printing. (define p (open-pipe* OPEN_BOTH "base64")) (format p "moo\n") (force-output p) (define output (get-bytevector-all p)) (format #t "~S\n" output)) (define (example-2) ;; Prints the literal empty string: "". (define output (with-output-to-string (lambda () (let* ((p (open-pipe* OPEN_WRITE "base64"))) (display "moo\n" p))))) (format #t "~S\n" output)) (define (example-3) ;; Prints the literal empty string: "". (define p (open-pipe* OPEN_BOTH "base64")) (format p "moo\n") (force-output p) (define output (drain-input p)) (format #t "~S\n" output)) (example-3) (example-2) (example-1)