[Pythonmac-SIG] Re: MacPython and line-endings

Paul Miller paul@fxtech.com
Thu, 11 Oct 2001 17:27:25 -0500


>Hmm, another potential problem that just occurred to me: will this
>work for fdopen()? On the mac it will (at least with
>MacPython/MSL/GUSI combo we're using), but I vaguely remember having
>seen some platform (could be widnows, therefore) where you also have a
>text flag to open() and where the open() mode should match the
>fdopen() mode.

Please forgive my ignorance:

Why can't we just replace the fgets call that reads the next line for 
script parsing with a function that does a buffered char-by-char read until 
any combination of \r, \n, or \n\r is found? Pretty much all cross-platform 
text-file reading code does it this way. The goal is to find a 
line-terminator - do we *really* care what it is?


-- 
Paul T. Miller | paul@fxtech.com | http://www.fxtech.com