[Ecls-list] RUN-PROGRAM

Dave Richards dave at synergy.org
Sun Jun 13 07:56:04 UTC 2004


This sounds very similar to the CLISP implementation.

One of my frustrations with this interface is that :wait nil isn't very
useful.  I was looking at using :wait nil in CLISP to implement a
variation on "pmake", which executes multiple programs concurrently.
For such an application it is essential that run-program have a
corresponding wait-program function for determining the exit status of a
previous run-program.

Sadly, because of my lack of desire to learn the embedding interface in
CLISP, I used Python for the project.

	Dave

-----Original Message-----
From: ecls-list-admin at lists.sourceforge.net
[mailto:ecls-list-admin at lists.sourceforge.net] On Behalf Of Juan Jose
Garcia Ripoll
Sent: Sunday, June 13, 2004 3:07 AM
To: ecls-list at lists.sourceforge.net
Subject: [Ecls-list] RUN-PROGRAM


Hi,

I just finished implementing EXT:RUN-PROGRAM, a function that allows to 
spawn child processes and send/receive data from them using pipes. Bare 
syntax:
    (EXT:RUN-PROGRAM command args-list &key input output error)

For :input, T means use the standard input of the parent, NIL means do 
not take any input but rather bind it to /dev/null, and :STREAM means 
build a stream that the parent can write to and the child can read from.

:output accepts similar arguments. :error does not accept :stream, but 
you can supply :OUTPUT which means that the error messages are 
redirected to standard output.

If either :input or :output had a value of :STREAM, RUN-PROGRAM outputs 
a bidirectional stream with which the parent can communicate with the 
child process.

An example:

(let ((stream (ext:run-program "cat" nil :input :stream :output
:stream)))
  (dotimes (i 10)
     (format t "Sending ~d~%" i)
     (print i stream)
     (format t "Received ~a~%" (read stream))))

To be done:

+ A :wait argument that specifies whether the parent should wait for the
child.

+ Another output argument that gives the child PID, plus a function 
KILL-PROGRAM to kill spawned processes.

Regards,

Juanjo



-------------------------------------------------------
This SF.Net email is sponsored by the new InstallShield X.
>From Windows to Linux, servers to mobile, InstallShield X is the
one installation-authoring solution that does it all. Learn more and
evaluate today! http://www.installshield.com/Dev2Dev/0504
_______________________________________________
Ecls-list mailing list
Ecls-list at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ecls-list







More information about the ecl-devel mailing list