Fix process spawning to accept any ~A formattable args.
This commit is contained in:
parent
111fb10229
commit
57c8b7321d
1 changed files with 7 additions and 2 deletions
|
@ -36,7 +36,8 @@
|
||||||
(import scheme
|
(import scheme
|
||||||
(chicken base)
|
(chicken base)
|
||||||
(chicken io)
|
(chicken io)
|
||||||
(chicken process))
|
(chicken process)
|
||||||
|
(chicken format))
|
||||||
|
|
||||||
;; If given string begins with UTF-8 BOM, it is removed.
|
;; If given string begins with UTF-8 BOM, it is removed.
|
||||||
(define (remove-optional-bom str)
|
(define (remove-optional-bom str)
|
||||||
|
@ -59,7 +60,11 @@
|
||||||
;; Very simple shell command wrapper that returns lines produced by
|
;; Very simple shell command wrapper that returns lines produced by
|
||||||
;; given command. Dangerous - performs no argument escaping!
|
;; given command. Dangerous - performs no argument escaping!
|
||||||
(define (get-process-output-lines cmd . args)
|
(define (get-process-output-lines cmd . args)
|
||||||
(let-values (((stdout stdin pid stderr) (process* cmd args)))
|
(let-values (((stdout stdin pid stderr)
|
||||||
|
(process* cmd
|
||||||
|
(map (lambda (x)
|
||||||
|
(format "~A" x))
|
||||||
|
args))))
|
||||||
(close-output-port stdin)
|
(close-output-port stdin)
|
||||||
(let ((result (read-lines stdout)))
|
(let ((result (read-lines stdout)))
|
||||||
(let-values (((a b c) (process-wait pid)))
|
(let-values (((a b c) (process-wait pid)))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue