[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: What is the output port of `system*'?
From: |
Diogo F. S. Ramos |
Subject: |
Re: What is the output port of `system*'? |
Date: |
Sun, 27 Apr 2014 16:27:48 -0300 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) |
>> As an example of this behavior, I point to the following Racket program:
>>
>> #lang racket
>>
>> (define foo
>> (with-output-to-string
>> (lambda ()
>> (system* (find-executable-path "ls") "/tmp"))))
>
> I agree that it would be nice to make this work as you expected. In
> order to handle ports that are not simply raw POSIX file descriptors
> (e.g. string ports), we'd need to create a pipe behind the scenes, and
> arrange for thread(s) in the current process to copy data between the
> pipe(s) and the Scheme port.
>
> I'd like to do this at some point, although for the sake of backward
> compatibility we'd probably have to leave 'system' and 'system*' as-is
> and create a new API that works more intuitively.
If you do, may I suggest taking a look at Racket's Processes?
I'm not aware of things like "custodian" or "synchromizable event" in
Guile, but I've used Racket's Processes successfully in the past.