When stdout-redirection: is #f, the output of the process will go to the POSIX stdout.
When it is #t, the output of the process will go to the process port, and you can read from that port to get the output.
For example:
(define program (list path: "ls" stdout-redirection: #t arguments: (list "-l")))
(pp (call-with-input-process program (lambda (port) (read-line port #f))))
Marc
On Mar 20, 2018, at 10:28 AM, C K Kashyap ckkashyap@gmail.com wrote:
Hello all,
I was hoping for this program to redirect the output of the forked process into a file -
(define program (list path: "ls" stdout-redirection: #f arguments: (list "-l")))
(with-output-to-file (list path: "output.txt") (lambda () (open-process program)))
But that does not seem to happen. I am not sure what I am missing here.
Regards, Kashyap
Gambit-list mailing list Gambit-list@iro.umontreal.ca https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list