On Sun, Feb 27, 2011 at 10:34 PM, Rupert Swarbrick <rswarbr...@gmail.com>wrote:

> Juan Jose Garcia-Ripoll
> <juanjose.garciarip...@googlemail.com> writes:
> > On Sun, Feb 27, 2011 at 8:59 PM, Rupert Swarbrick <rswarbr...@gmail.com
> >wrote:
> >
> >>
> >> Hmm, I'm not sure it does actually :-( I've just compiled the latest
> >> code from git (0df960178922fb0dba752356e59d6194975f333e) and with the
> >> following definition:
> >>
> >
> > This is not the latest. Last two patches are shown below. It may take
> time
> > for changes to propagate.
> >
> > Juanjo
> >
> > $ git log -2
> > commit 0df960178922fb0dba752356e59d6194975f333e
> > Author: Juan Jose Garcia Ripoll <jjgar...@users.sourceforge.net>
> > Date:   Sun Feb 27 17:02:18 2011 +0100
> >
> >     EXT:EXTERNAL-PROCESS-WAIT ignores -1 on Windows platforms.
> >
> ...
>
> Thank you very much for the reply, but isn't this the commit I've got?



Sorry for my temporary dyslexia, but did you rebuild from scratch? What
operating system are you using? I modified your test to look as I show below
and everything works fine. See the output on a Linux box, without zombies:

$ ecl -norc -load foo.lsp -eval '(quit)'
;;; Loading "/home/jjgarcia/build/ecl/foo.lsp"
Read line
test
21264 pts/0    S+     0:00 ecl -norc -load foo.lsp -eval (quit)
21268 pts/0    S+     0:00 sh -c ps awx|grep foo
21270 pts/0    S+     0:00 grep foo

foo.lsp:

(with-open-file (s "foo.sh" :direction :output

                   :if-exists :supersede)

  (format s "#~~/bin/sh

read x

echo Read line

echo $x

")

  (ext:system "chmod +x foo.sh"))



(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 t

                                       :input :stream)))

        (in (si:external-process-input p)))

   (princ str in) (princ #\Newline in) (close in)

   (values)))



(string>program "test" "./foo.sh")

(ext:system "ps awx|grep foo")



-- 
Instituto de FĂ­sica Fundamental, CSIC
c/ Serrano, 113b, Madrid 28006 (Spain)
http://juanjose.garciaripoll.googlepages.com
------------------------------------------------------------------------------
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