On Jan 17, 2007, at 2:43 PM, John Cowan wrote:
Zbigniew scripsit:
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().
Furthermore, this makes for a sensible approach to disposition.
You get
three values back from "process", two ports and a PID. It's up to you
to close each port and wait on the PID in order to properly
dispose of everything.
What do people think? Should the wait() be removed from process?
Yes, I'd say so; it's not hard to insert a call to "wait" right after
closing the input port.
I had to add much nonsense so 'osprocess' can access the exit status
when the ports are closed. But keeping the current behavior was
important, or so I thought.
A couple of points:
1) 'process-wait' in posixunix throws an exception upon an error but
doesn't in posixwin. (Think both should throw exception.)
2) 'process' waits automatically in posixunix but not in posixwin.
(Think shouldn't wait.)
3) 'process' will throw an exception for abnormal exit in posixunix
but not in posixwin. (Think shouldn't throw exception.)
I would like to get these in parallel.
--
John Cowan [EMAIL PROTECTED] http://ccil.org/~cowan
Big as a house, much bigger than a house, it looked to [Sam], a
grey-clad
moving hill. Fear and wonder, maybe, enlarged him in the hobbit's
eyes,
but the Mumak of Harad was indeed a beast of vast bulk, and the
like of him
does not walk now in Middle-earth; his kin that live still in
latter days are
but memories of his girth and his majesty. --"Of Herbs and Stewed
Rabbit"
_______________________________________________
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users