[plt-scheme] reading a whole file

From: Veer (diggerrrrr at gmail.com)
Date: Tue Nov 4 09:34:19 EST 2008

How about this :

(call-with-input-file filename (lambda (in)
                                 (bytes->string/utf-8
                                  (read-bytes (file-size filename) in)))))

On 11/4/08, Stephen De Gabrielle <spdegabrielle at gmail.com> wrote:
> This is embarassing, as I'm sure I've asked it before, but can't find
> the answer;
>
> Is there a function to read a whole file into memory (as a string)
>
>  (lambda (i) (read-string 80000 i))
> or is there something better?
>
> Cheers,
>
> Stephen
> _________________________________________________
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>


Posted on the users mailing list.