Binary vs non-binary

Kiyo Kelvin Lee kiyolee*remove* at ctimail.com
Sat Nov 27 12:35:28 CET 1999


Binary file is only applicable in DOS/Windows. File opened in binary mode
will treat CR and LF as 2 separate characters while in text mode CR and LF
will be translated into a single CR. It's an old "feature" of C compilers
for DOS/Windows.
Kiyo

"Gerrit Holl" <gerrit.holl at pobox.com> wrote in message
news:19991127103504.A1536 at stopcontact.palga.uucp...
> Hello,
>
> can someone explain me the difference in opening a file in binary mode
> and opening it not in binary mode? And when is some file defined to be
> binary, when it contains an ASCII 0? If so, I understand you need to say
> it's binary in C, but if Python doesn't store it strings with an ASCII 0
> on the end, why is there any difference?
>
> regards,
> Gerrit.
>
> --
> "The world is beating a path to our door"
>
>   -- Bruce Perens, (Open Sources, 1999 O'Reilly and Associates)
>  10:33am  up 17 min,  9 users,  load average: 1.81, 1.47, 0.79
>
>





More information about the Python-list mailing list