Thanks for the detailed description.

Bob


On Oct 19, 2005, at 1:01 AM, Tim Hammerquist wrote:

> Robert Evans <robert.evans / acm.org> wrote:
>
>> I have written some code that reads bytes from a file in bigendian
>> order (the file was written in big-endian order). It works fine on
>> unix, but on windows it dies when it encounters 1a, also known as 26
>> also known as ctrl-z also known as an eof character in dos. This
>> causes the read to stop. Is this a known bug? Is something else going
>> on here?
>>
>
> ASCII 26 is the EOF character for text files in DOS/Windows
> systems.  In order to treat 0x1a as "just another byte", you
> need to open the file in binary mode.  This is done by using the
> 'b' mode indicator.  Binary mode on Windows/DOS systems also
> turns off some line-ending handling used for text files.
>
> Using binary mode on files on a Unix system has no effect, and
> is safe to use when there is a chance the code may be run on
> a Microsoft OS.
>
> Tim Hammerquist
>
>