[Pythonmac-SIG] Re: [Python-Dev] Import hook to do end-of-line conversion?

Greg Ewing greg@cosc.canterbury.ac.nz
Tue, 10 Apr 2001 13:07:28 +1200 (NZST)


Chris Barker <chrishbarker@home.net>:

> If a program is running on a windows box, and writing a file on a *nix
> server, what kind of line ending should it write? Would it even know
> what the native format is on the server? It seems we would need to be
> able to specify the line ending format explicitly for writing.

Yes, I think that's the best that can be done. To do any better
would require all file servers to be aware of the text/binary
distinction and be willing to translate, and for there to be
some way for the Python file object to communicate to the OS
which mode is intended. Neither of these things are true in
general.

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg@cosc.canterbury.ac.nz	   +--------------------------------------+