[ltk-user] no error stream use

Kenny Tilton ktilton at nyc.rr.com
Thu Feb 2 17:16:37 UTC 2006


Peter Herth wrote:

>On 2/2/06, Kenny Tilton <ktilton at nyc.rr.com> wrote:
>  
>
>>Is there some reason the error stream from Tk is not being used? In
>>Celtic I bound that to a second global and read that (with read-line,
>>not read since the error output is not Lisp friendly) before trying to
>>read the regular stream.
>>
>>As it is read-data just flails away at error text until it hits
>>something that upsets the reader, such as a comma.
>>    
>>
>
>Well, there is no deep reason - besides I do not know offhand how the
>support for a seperate error stream across all the lisps Ltk runs on
>is. For sure, it probably would remove some of the weird errors of Ltk
>when Tk sends something unreadable...
>  
>

Here is the change I made for Celtic:

    #+allegro (multiple-value-bind (stream error-stream process-id)
                  (excl:run-shell-command
                   #+mswindows fullstring
                   #-mswindows (apply #'vector program program args)
                   :input :stream :output :stream
                   :error-output :stream
                   :wait wt)
                (declare (ignorable dummy error-stream process-id))
                (trc "doexec!!!> " stream error-stream process-id)
                (if stream
                    (progn
                      (setf *ewish* error-stream)
                      stream)
                  (error "Cannot create WISH process.")))))


Then before reading *wish* (this of course in the day when that was the 
stream):

   (loop
        while (peek-char-no-hang *ewish*)
        do (break "ewish!!!!!!!> ~a" (read-line *ewish* nil nil)))

That looks like it could be a little smarter and not break until all the 
error output was read, but that is the general idea.

kt



More information about the ltk-user mailing list