Subject: [clisp-list] Re: CGI & binary i/o with stdio: solution proposal

From: "Hoehle, Joerg-Cyril" <[email-masked]>
Date: Thu May 15 01:19:01 2003

Hi,

I wrote
>1. What should *standard-error* become in such a case?
>It would be wise *not* to have it bound to the file stream 
>object as *standard-output*. If it's used in binary mode, an 
>infinite loop results of this, and a Lisp STACK overflow. I 
>prefer to have *standard-error* still point to *terminal-io* 
>(which remains a pure character stream) (or a handle for file 
>descriptor #2, if exists). That means that error and trace 
>messages would be mixed as ASCII into the binary output -- at 
>least you get to see something.

Actually, I confused myself yesterday: with my patch, it's *not* the case that you'd have a usable *terminal-io* in character mode while *standard-input* or -output* would be in byte mode.

*terminal-io* becomes a two-way-stream, with these setf'able *standard-input* and -output* streams as components.

However, my patch provides a valuable property that (setf (stream-element-type *terminal-io*) would not:
Element-type of stdin and output can be set independently!
I believe this is a necessity for both pipe and cgi applications.

Yet I think it still would be nice to have *terminal-io* always be in character mode for both directions (at least with options like -repl or -interactive-debug). Possibly there could be distinct *standard-input* and -output* -- at least in batch mode. That's different from my patch.

Regards,
	Jorg Hohle.