From: Juanma Barranquero

Subject: Streams

Date: 1999-3-3 11:27

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wed, 03 Mar 1999 09:32:37 -0600, Ken Forbus wrote:

>This is a technical support list for a particular Lisp product.
Well then, I'd like to ask a technical question. Does anyone ever implemented custom streams using the CLOSified streams of ACL? Documentation on ACL's implementation of streams is nowhere as clear as I'd like. A few examples would be *very* welcome. I'm writing bindings for using the ZLib open-source compression library from ACL for Windows. That works just fine. Now I'd like to write a wrapper so the user could write: (with-gzfile-stream (gzfile "d:/usr/test/test.gz" :direction :output :if-does-not-exist :create :mode :text)) (format gzfile "This is a ~A~%" "line of data") (write-string "This is another line of data" gzfile) (terpri gzfile)) etc. Now I've reached the point where I can create a custom stream (with excl::def-stream-class) and really write to/read from it. But the interface through open seems clumsy. I don't know how to use open to create the stream *without* it also creating the file. I don't want that, as gz-open does it already. I can skip open altogether and use (make-instance 'gzfile-stream) directly, but then I have to write my own parsing of open keyword parameters, etc... ZLib has a gzfdopen call that reuses a file descriptor, but unfortunately that fd is a C RTL thingy and not a Windows filehandle, so I cannot pass it the internal fd used by the file-stream implementation... So, why do you (the generic "you", I mean) think is the best approach? Does anyone have code/examples of deriving the string-stream classes or other streams that do *not* directly connect with a physical file? Thanks for your input, /L/e/k/t/u -----BEGIN PGP SIGNATURE----- Version: PGPfreeware 6.0.2i iQA/AwUBNt1Uff4C0a0jUw5YEQLWXACgs3b6UaPCJrWiNbJGJPje41ScCW4AoMME 7d2bZbs8n/N2MdMt5fHaLQKM =94Zb -----END PGP SIGNATURE-----