[Chicken-users] read-line (and probably other input routines) - unexpect
[Chicken-users] read-line (and probably other input routines) - unexpected behaviour when reading binary files on Windows
Tue, 17 Oct 2006 13:42:25 +0400
---------- Forwarded message ---------- From: $) <address@hidden> Date: 17.10.2006 13:30 Subject: read-line (and probably other input routines) - unexpected behaviour when reading binary files on Windows
Hi! The Chicken manual says that read-line consumes all input from the current input port untill #!eof when called without parameters.
The weird thing is that Scheme IO treats #\x1a (character with code 27) as #!eof when reading from file. The following code snippet prints #!eof:
(define crash-pattern "\x1a (esc) breaks read-line \x1a it is weird") (with-output-to-file "test.scm.123" (lambda() (display crash-pattern))) (print(with-input-from-file "test.scm.123
The file "test.scm.123" is written successfully. So I guess that something goes wrong while reading the file?
With-input-from-string or even reading from custom port behaves as expected: