[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] read-line (and probably other input routines) - unex
Re: [Chicken-users] read-line (and probably other input routines) - unexpected behaviour when reading binary files on Windows
Tue, 17 Oct 2006 09:09:48 -0400
> The weird thing is that Scheme IO treats #\x1a (character with code 27) as
> #!eof when reading from file.
This is a behavior hardwired into the Windows C library for compatibility
(I kid you not) with the CP/M operating system for 8-bit micros, which
did not record the exact length of a file in the file system and had to
use Ctrl-Z as a conventional EOF mark. This behavior was in turn inherited
from the ancient DEC operating systems OS/8 and RT-11.
Turning on binary mode for the file will suppress this behavior.
John Cowan address@hidden http://ccil.org/~cowan
Original line from The Warrior's Apprentice by Lois McMaster Bujold:
"Only on Barrayar would pulling a loaded needler start a stampede toward one."
English-to-Russian-to-English mangling thereof: "Only on Barrayar you risk to
lose support instead of finding it when you threat with the charged weapon."