50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
-
+
|
(define (process:cmd-run-proc-each-line cmd proc . params)
;; (print "Called with cmd=" cmd ", proc=" proc ", params=" params)
(handle-exceptions
exn
(begin
(print "ERROR: Failed to run command: " cmd " " (string-intersperse params " "))
(debug:print 0 *default-log-port* " message: " ((condition-property-accessor 'exn 'message) exn))
(print "exn=" (condition->list exn))
(debug:print 5 *default-log-port* "exn=" (condition->list exn))
#f)
(let-values (((fh fho pid) (if (null? params)
(process cmd)
(process cmd params))))
(let loop ((curr (read-line fh))
(result '()))
(if (not (eof-object? curr))
|