[Ecls-list] Potential problem with streams and EXT:RUN-PROGRAM
Juan Jose Garcia Ripoll
jlr at mpq.mpg.de
Wed May 18 07:04:41 UTC 2005
Goffioul Michael wrote:
>During a few days, I fought with a problem I had with my matlab-embedded-ECL: the
>symptom was a stream error after a call to EXT:RUN-PROGRAM, but it often happen
>in an unpredictable way.
>
>Looking at the code of that function, I realized that the standard handles are
>duplicated, but this doesn't take into account the actual value of the variables
>*standard-input/output* and the like. This means that if you redefine the LISP
>standard input/outputs (which is my case), ext:run-program doesn't take that into
>account.
>
>In my particular case, the problem was that :error is T by default, such that the
>child program got a duplicated handle of stderr. In the context of MATLAB, writing
>to that handle produced errors (it's still unclear why this happen).
>
>
With current fixes EXT:RUN-PROGRAM inspects the variables
*STANDARD-INPUT/OUTPUT* and *ERROR-OUTPUT* to decide what handles the
children processes should get. If you want the child's error output to
be discarded, it should suffice to set *ERROR-OUTPUT* to some stupid
value, which is not a valid file, or, as you noticed, passing a value of
:ERROR NIL to the routine EXT:RUN-PROGRAM.
Juanjo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jlr.vcf
Type: text/x-vcard
Size: 361 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20050518/87d1d2e7/attachment.vcf>
More information about the ecl-devel
mailing list