I don't understand why the following example is encountering an error
attempting to READ-CHAR from the stream returned calling PROCESS-PTY
on the result of RUN-PROGRAM.
[····@csdndev08 kick/sparc-sun-solaris2.6]% cmucl
CMU Common Lisp 18e, running on csdndev08
With core: /usr/test/awo/user_work/kick/sparc-sun-solaris2.6/lib/cmucl/lib/lisp.core
Dumped on: Tue, 2003-04-08 13:23:10-05:00 on achat
See <http://www.cons.org/cmucl/> for support information.
Loaded subsystems:
Python 1.1, target SPARCstation/Solaris 2
CLOS 18e (based on PCL September 16 92 PCL (f))
* (progn
(setq *p* (run-program "uname" nil :wait nil :pty t))
(format t "(process-status *p*) => ~A~%" (process-status *p*))
(setq *s* (process-pty *p*))
(format t "(process-status *p*) => ~A~%" (process-status *p*))
(read-char *s*)
(format t "(process-status *p*) => ~A~%" (process-status *p*)))
Warning: Declaring *P* special.
(process-status *p*) => RUNNING
Warning: Declaring *S* special.
(process-status *p*) => RUNNING
Error in function COMMON-LISP::DO-INPUT:
Error reading #<Stream for descriptor 12>: I/O error
Restarts:
0: [ABORT] Return to Top-Level.
Debug (type H for help)
(COMMON-LISP::DO-INPUT #<Stream for descriptor 12>)
Source: Error finding source:
Error in function DEBUG::GET-FILE-TOP-LEVEL-FORM: Source file no longer exists:
target:code/fd-stream.lisp.
0] 0
* (process-close *p*)
#<process 13942 :EXITED>
*
The following works as I would expect.
* (run-program "uname" nil :output t)
SunOS
#<process 13960 :EXITED>
*
····@rpw3.org (Rob Warnock) writes:
> Damien Kick <······@email.mot.com> wrote:
> +---------------
> | I don't understand why the following example is encountering an error
> | attempting to READ-CHAR from the stream returned calling PROCESS-PTY
> | on the result of RUN-PROGRAM.
> ...
> | CMU Common Lisp 18e, running on csdndev08
> | * (progn
> | (setq *p* (run-program "uname" nil :wait nil :pty t))
> | ... )
> +---------------
>
> I've never managed to use :PTY for anything, but specifying the
> options ":OUTPUT :STREAM" & ":ERROR :OUTPUT" usually works for me:
The example in the OP does not actually need to be run in a
pseudo-terminal, as it is just collecting the result of "uname".
However, I'm more concerned with running programs that will want a
pseudo-terminal, e.g. controlling a telnet session. I'm assuming that
simply using ":OUTPUT" and ":ERROR" do not have the program running in
a pseudo-terminal.
Damien Kick <······@email.mot.com> wrote:
+---------------
| ····@rpw3.org (Rob Warnock) writes:
| > I've never managed to use :PTY for anything, but specifying the
| > options ":OUTPUT :STREAM" & ":ERROR :OUTPUT" usually works for me:
|
| The example in the OP does not actually need to be run in a
| pseudo-terminal, as it is just collecting the result of "uname".
| However, I'm more concerned with running programs that will want a
| pseudo-terminal, e.g. controlling a telnet session. I'm assuming that
| simply using ":OUTPUT" and ":ERROR" do not have the program running in
| a pseudo-terminal.
+---------------
Nope, just pipes.
-Rob
-----
Rob Warnock, PP-ASEL-IA <····@rpw3.org>
627 26th Avenue <URL:http://rpw3.org/>
San Mateo, CA 94403 (650)572-2607