On Wed, Jan 17, 2007 at 11:26:27AM +0100, felix winkelmann wrote: > On 1/17/07, Robin Lee Powell <[EMAIL PROTECTED]> wrote: > >On Sun, Jan 14, 2007 at 09:53:00PM -0800, Robin Lee Powell wrote: > >> > >> The only way I see to get the exit value of something I call > >> with (process...) is to use (process-wait), but as I mentioned > >> in another mail, this errors out my entire program if the > >> process is already finished, so I can't see any way to do all > >> of the following: > >> > > If you start a subprocess with `process', the waitpid(2) is done > by closing the input and output port returned. If you want to get > at the exit-status, you should try to start a process via more > primitive functions, like `process-fork'. There a `process-wait' > gives you all necessary information (and the error can be caught > using `handle-exceptions'). To get at stdin/out, one can use the > usual fork/dup/exec dance to obtain file-descriptors (albeit in > Scheme using the functionality in the posix unit).
The problem is, the programs I'm calling tend to complete the instant I gather their output. If the program is gone by the time I call process-wait, I don't get the exit status, so this really doesn't help me. I'm looking for something like the shell's $? here. Can I maybe hack process to do that? -Robin -- http://www.digitalkingdom.org/~rlpowell/ *** http://www.lojban.org/ Reason #237 To Learn Lojban: "Homonyms: Their Grate!" Proud Supporter of the Singularity Institute - http://singinst.org/ _______________________________________________ Chicken-users mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/chicken-users
