I would agree with Kon on this---osprocess should work and give you more options. To me the overall problem is that opening both a read and write pipe to a process contains a bit of magic, and is not as easy as one might suppose. For example, many times you are better opening a pseudo tty, although your case seems not to require it. "process" just won't handle all the permutations you might want even if you start hacking on it, and eventually it would become osprocess.
Let's take a step back. Normally, you open a unidirectional pipe and then grab the exit status via close-input-pipe or close-output-pipe -- the close will do a waitpid() for you and return the exit code. For a bi-directional pipe, should you return the PID when closing the input side, or the output side, or when the last one is closed? It is not clear. Additionally, as currently implemented, the bi-directional pipes are custom ports, which (from my admittedly cursory reading of the code) cannot return a value via close-input-port or close-output-port. The return value is unspecified, as noted in R5RS. Now, you might argue that custom ports should be able to return a value via close, and this value (for ports returned by "process") should be the exit code of the process. It looks to me like this could be done with just a bit of hacking. But you might have more success arguing that "process" should not ever invoke a wait() call when you close its ports, and instead leave that up to the user. Since you receive the PID from "process", you can process-wait on it, and retrieve the error code yourself. This way, process does the dirty work of setting up and tearing down a new process and bi-directional pipes, while you can do the easy work of wait(). What do people think? Should the wait() be removed from process? I myself think the point is moot, because I avoid bi-directional pipes at all costs. :) On 1/17/07, Kon Lovett <[EMAIL PROTECTED]> wrote:
You can also try the "osprocess" egg. It will capture the exit status when the ports are closed. Needs a current Chicken though, >= 2.513
_______________________________________________ Chicken-users mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/chicken-users
