Hal E. Fulton wrote: >> IO#binmode put IO in binary mode only if there's such thing on the >> platform, otherwise do nothing. >> >> matz. > >OK... I guess I expected an embedded ^Z to mean end-of-file. >When I use TYPE on such a file, it stops at the control-Z; but >Ruby reads past it with or without binmode. > >I'm sure this is correct behavior and I'm just misunderstanding. >Probably the OS "knows" somehow that my eof is fake (though >TYPE certainly doesn't know). Actually, TYPE *thinks* ^Z is an EOF marker, even though the OS doesn't. CP/M didn't store exact byte lengths of files, so they needed some way to know where the end was. Even though MS-DOS knows, it kept ^Z around for backward compatibility with CP/M. Very few apps use ^Z any more. >So is there any other difference in the two modes except for >LF vs. CRLF? I woudn't expect there to be any, but I haven't looked at the code. Kevin