[plt-scheme] The filename of the file in the definition window

From: Jens Axel Soegaard (jensaxel at soegaard.net)
Date: Thu Dec 20 14:18:09 EST 2007

Matthew Flatt skrev:
> At Wed, 19 Dec 2007 16:09:42 -0600, "Robby Findler" wrote:
>>> Well, I as described above I actually want to call the external
>>> tool via "system" from (lib "process.ss"), so I can't pass
>>> the port along.
>> Sure you can! (Well, "pass" was the wrong word but the idea is right.)
>>
>> Check out (lib "port.ss"). You can to create a thread that does a
>> copy-port from the port you've got there to the input port you get
>> from the process call. You'll need a pipe inbetween.

A little simpler just to embed the filename in the shell command :-)

>> Be sure to close your ports (the pipe ones too).
> 
> Avoid creating pipes, because it creates too much work for you in
> managing a concurrent copy operation and closing the pipe at the right
> time. Instead, parameterize the call to `system' to set
> `current-input-port' to your port.

But perhaps not so involved as would could fear.


Robby: Greate idea to turn the hack into a blog post.

Thanks for the suggestions,
Jens Axel Søgaard


Posted on the users mailing list.