- New function EXT:ENVIRON returns the list of strings that makes up the
   process environment. This is the equivalent of POSIX (char **environ)
   and Windows' GetEnvironmentStrings.

 - EXT:RUN-PROGRAM now accepts a keyword argument, :ENVIRON, which is a
   list of strings configuring the environment of the child process.

 - EXT:RUN-PROGRAM returns as second value an EXT:EXTERNAL-PROCESS structure,
   which supports the queries EXT:EXTERNAL-PROCESS-{PID,INPUT,OUTPUT,STATUS},
   following CCL's conventions.

 - New function EXT:EXTERNAL-PROCESS-WAIT to wait indefinitely or simply query
   the status of a process.

This more or less seems to work in Unix. I am now testing the changes in Windows and will be probably uploading improvements tonight if I find problems.

Juanjo

$ ecl
ECL (Embeddable Common-Lisp) 10.1.1
Copyright (C) 1984 Taiichi Yuasa and Masami Hagiya
Copyright (C) 1993 Giuseppe Attardi
Copyright (C) 2000 Juan J. Garcia-Ripoll
ECL is free software, and you are welcome to redistribute it
under certain conditions; see file 'Copyright' for details.
Type :h for Help.  
Top level.
> (multiple-value-setq (file status process) (ext:run-program "./foo.sh" nil :wait nil))
#<two-way stream 00109fa0>
> file
#<two-way stream 00109fa0>
> status
NIL
> process
#S(SI:EXTERNAL-PROCESS :SI::PID 19446 :SI::INPUT #<output stream "./foo.sh"> :SI::OUTPUT #<input stream "./foo.sh"> :SI::%STATUS :RUNNING :SI::%CODE NIL)
> (ext:external-process-status process)
:EXITED
0
> (ext:external-process-wait process)
:EXITED
0
> (multiple-value-setq (file status process) (ext:run-program "./foo.sh" nil :wait t))
#<two-way stream 00109cd0>
> status
0
> process
#S(SI:EXTERNAL-PROCESS :SI::PID NIL :SI::INPUT #<output stream "./foo.sh"> :SI::OUTPUT #<input stream "./foo.sh"> :SI::%STATUS :EXITED :SI::%CODE 0)


--
Instituto de Física Fundamental, CSIC
c/ Serrano, 113b, Madrid 28006 (Spain)
http://juanjose.garciaripoll.googlepages.com