guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Read n bytes


From: Sam Phillips
Subject: Read n bytes
Date: Thu, 20 Dec 2001 19:19:04 -0800
User-agent: Mutt/1.3.24i

Hi, 

I'm slightly new to guile/scheme.  I've been using it heavily for about
the past month.  

Currently I'm trying find (or write) a routine that will read n bytes
from a port.  My current failed attempt is

(define (read-num-chars port len)
    (let ((ret ""))
        (do ((i len (- len 1)))
            ((eq? 0 i) ret)
            (set! ret (string-append ret (list->string (list (read-char 
port)))))
        )
    )
)

I'm sure there's an easier way to do this, but with my current knowledge
of scheme I can't uncover it.

TIA
Sam

-- 
Sam Phillips <address@hidden>                http://www.dasbistro.com
Reno                                                              Nevada



reply via email to

[Prev in Thread] Current Thread [Next in Thread]