[gzip-stream-devel] read-line

Apparently read-line is not available yet. On sbcl: (with-open-gzip-file (s "text.gz") (read-line s)) results in : There is no applicable method for the generic function #<STANDARD-GENERIC-FUNCTION STREAM-READ-LINE (1)> when called with arguments (#<GZIP-INPUT-STREAM {BC11CC9}>). [Condition of type SIMPLE-ERROR] Restarts: 0: [ABORT-REQUEST] Abort handling SLIME request. 1: [TERMINATE-THREAD] Terminate this thread (#<THREAD "repl-thread" {B1F4EA9}>) Backtrace: 0: ((SB-PCL::FAST-METHOD NO-APPLICABLE-METHOD (T)) #<unavailable argument> #<unavailable argument> #<STANDARD-GENERIC-FUNCTION STREAM-READ-LINE (1)> (#<GZIP-INPUT-STREAM {BC11CC9}>)) 1: ((SB-PCL::FAST-METHOD NO-APPLICABLE-METHOD (T)) #<unavailable argument> #<unavailable argument> #<STANDARD-GENERIC-FUNCTION STREAM-READ-LINE (1)> (#<GZIP-INPUT-STREAM {BC11CC9}>)) 2: (READ-LINE #<GZIP-INPUT-STREAM {BC11CC9}> T NIL #<unused argument>) 3: (NIL) 4: (SB-INT:EVAL-IN-LEXENV (WITH-OPEN-GZIP-FILE (S "text.gz") (READ-LINE S)) #<NULL-LEXENV>) I hope at some point I'll figure out how to provide stream-read-line (but not today, I am fairly new at actually using CL)

Alexey Goldin wrote:
Apparently read-line is not available yet. On sbcl:
(with-open-gzip-file (s "text.gz") (read-line s))
Yeah, unfortunately the gzip-streams have an element-type of '(unsigned-byte 8) and as such I didn't implement read-line on them, i assumed (poorly) that there would be a more readable error than no such applicable method. as a workaround for now you should be able to use Edi Weitz's excellent flexi-streams <http://cliki.net/flexi-streams> to enable read-line usage. eg. (gzip-stream:with-open-gzip-file (s "e:/dapper.htm.gz") (setf s (flexi-streams:make-flexi-stream s)) (read-line s)) This will be addressed sometime in the future. Cheers, Sean.
participants (2)
-
Alexey Goldin
-
Sean Ross