The integrated cross-platform development tool for ANSI Common Lisp LispWorks logo

Lisp Knowledgebase



Title: How to start a window executable and return a stream.

ID: 10030


Product: LispWorks for Windows
Version: 4.1, 4.2
OS: All Windows platforms

Description: The line to port from Linux/Allegro reads:

(setq *lisp-to-wish-stream*
     (excl:run-shell-command "itkwish top.tcl"
                             :input :stream :output :stream))


In Lispworks 4.2 it would be written:

(setq *lisp-to-wish-stream*
(sys:open-pipe "itkwish top.tcl"))


See the doc in the Release and Installation Notes.


In Lispworks 4.1 it would be written:

(setq *lisp-to-wish-stream*
(win32::open-pipe :command-line "itkwish top.tcl"))


Package: WIN32

Syntax: OPEN-PIPE &KEY APPLICATION-NAME COMMAND-LINE CURRENT-DIRECTORY

Invokes CreateProcess and returns a stream which you can read from.
See the MS documentation on CreateProcess for interpretation of the
arguments. Beware that the CL input functions may hang if there's no
input on the stream so check for this using LISTEN e.g.

CL-USER 90 > (defvar *pipe*)
*PIPE*

CL-USER 91 > (setf *pipe* (win32::open-pipe :command-line "net view"))
#S(IO::TWO-WAY-PIPE-STREAM IO::UNTYID-CHAR NIL IO::INPUT #<FILE-STREAM NIL> IO::OUTPUT #<FILE-STREAM NIL> IO::HPROCESS 372)

CL-USER 92 > (loop (loop while (and (listen *pipe*)
                                   (print (read-line *pipe*))))
                  (sleep 1)
                  (unless (listen *pipe*) (return)))

"Server Name            Remark"
""
"-------------------------------------------------------------------------------"

[... lots of machine names elided ... ]

"The command completed successfully."
""
NIL

See Also:
Workaround:
Patch:

Hardware:N/A
Summary:What is the command which starts a window executable and
returns a stream?
Bug#:
Patch Enhancement#:
Reported:5645, 4434

Top | Back