read the whole file into a string?

William Xuuu <[email protected]>
Newsgroups gmane.lisp.scheme.scsh
Organization the Church of Emacs
Message-ID <[email protected]>
Hi,

A simple question, how to read a file into one single string? I looked into
the manuals of scsh, only found this:

(read-string nbytes [fd/port])     --->     string or #f (procedure)
(read-string! str [fd/port start end]) --->     nread or #f (procedure)

I took a try:

(let* ((port (open-file "/tmp/foo" open/read))
       (str (read-string 100 port)))
  (display str))

Can someone give me a hint? 

thanks.

--
William
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.