On 9/13/05, Michael Chermside <[EMAIL PROTECTED]> wrote:
> In unix, the above is true. One of the fundamental decisions in Unix
> was to treat all files (and lots of other vaguely file-like things)
> as undiferentiated streams of bytes. But this is NOT true on many
> other operating systems. It is not, for example, true on Windows.

<nitpick>
Actually, on Windows, it *is* true. At the OS API level, all files are
streams of bytes (it's not as uniform as Unix - many things that Unix
forces into a file-like mould don't look exactly like OS-level files
on Windows, consoles and sockets being particular examples). However,
at the C library level, text files are "special" insofar as the C
stdio routines handle CRLF issues and the like differently.

The problem is twofold: (1) that Python works with the C runtime, so
stdio behaviour gets involved, and (2) on Windows, the familiar Unix/C
conventions of "\n" for "newline" don't work without translation - so
if you write text to a binary file, your output doesn't conform to the
*conventions* used by other applications (notably notepad - it's
surprising how many Windows programs actually work fine with
LF-delimited lines in text files...)
</nitpick>

Paul.
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to