Detecting EOF in a Binary File using Scheme
Posted
by yuguang
on Stack Overflow
See other posts from Stack Overflow
or by yuguang
Published on 2009-10-20T02:33:05Z
Indexed on
2010/03/11
21:04 UTC
Read the original article
Hit count: 683
Scheme
|plt-scheme
(define (read-all-input)
(local ((define line (bytes->list (read-bytes 4))))
(if (eof-object? line)
empty
(cons line (read-all-input)))))
(void (read-all-input))
The above code fails because bytes->list expects an argument of type byte string, but is given #
© Stack Overflow or respective owner