Juan Jose Garcia-Ripoll
<juanjose.garciarip...@googlemail.com> writes:
> On Sun, Feb 27, 2011 at 5:04 PM, Juan Jose Garcia-Ripoll <
> juanjose.garciarip...@googlemail.com> wrote:
>
>> Actually it should have worked, but for some reason it does not. I have
>> tried various things and as a last resort I had to introduce a signal
>> handler for SIGCHLD that updates a new list of external (and active)
>> processes.
>>
>
> Just in case it was not obvious, this means that the code in Rupert's email
> now seems to work with ECL on POSIX (Linux, *BSD, OS X)
>
> Juanjo

Hmm, I'm not sure it does actually :-( I've just compiled the latest
code from git (0df960178922fb0dba752356e59d6194975f333e) and with the
following definition:

(defun string>program (str program &rest args)
  "Run program reading from STR as stdin."
  #+sbcl
  (with-input-from-string (s str)
    (sb-ext:run-program program args :input s)
    (values))
  #+ecl
  (let* ((p (nth-value 2
                       (ext:run-program program args
                                        :wait nil :error nil :output nil
                                        :input :stream)))
         (in (si:external-process-input p)))
    (princ str in) (princ #\Newline in) (close in)
    (values)))

when I run

(string>program "test" "/home/rupert/doit.sh")

where doit.sh has the contents:

#!/bin/bash

read x
echo $x >~/tmp.txt

I still get the right stuff in tmp.txt but 'ps aux | grep doit' gives
me:

rupert@hake:~ ps aux | grep doit
rupert   16120  0.0  0.0      0     0 ?        Z    19:54   0:00 [doit.sh] 
<defunct>
rupert   16263  0.0  0.0      0     0 ?        Z    19:54   0:00 [doit.sh] 
<defunct>
rupert   16266  0.0  0.0   5048   724 pts/0    S+   19:54   0:00 grep doit

(this is after running the function twice).



Am I doing something wrong?

Rupert

Attachment: pgpGP0z8eaSVT.pgp
Description: PGP signature

------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in 
Real-Time with Splunk. Collect, index and harness all the fast moving IT data 
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business 
insights. http://p.sf.net/sfu/splunk-dev2dev 
_______________________________________________
Ecls-list mailing list
Ecls-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ecls-list

Reply via email to