Re: Mac text files and gets()

new topic     » topic index » view thread      » older message » newer message

Robert Craig wrote:
> 
> In Euphoria, "r" and "rb" are equivalent on Linux/FreeBSD,
> Only DOS/Windows has the silly concept
> In DOS/Windows, although I think it's a bad idea,
> you could argue that "r" mode (but certainly not "rb" mode)
> gives you license to alter the input and detect many different 
> You really can't mess around with "r" mode
> on Linux/FreeBSD. You *will* break code.
> 
I feel lost/need a quick recap on this:
Dos/Windows standard is \r\n
Linux standard is \n
Mac standard is \r

This discussion is only about reading files, I take it no changes are proposed
to the way write works.

Under D/W, "r" mode replaces \r\n with \n, leaves \r alone, alone, and leaves \n
alone, alone. "rb" mode leaves all three as-is.
Under Linux, both "r" and "rb" mode leave all three alone, correct?
(no Eu on Mac yet so n/a)

What happens when Linux finds a \r alone? (leaves it asis, I guess).
Is there any market for Linux to read D/W files as \n alone?

What is the pukka code for:

#ifdef EWINDOWS
   if (!binary_mode) {
 		    if (c == '\r') {
                         c = '\n';

And lastly, what would the full testset be for all concerned to be happy?

> As for DOS/Windows, if you are still determined
> to add this, we can eventually have a vote on it.
> My vote would be NO.
I am leaning toward the same, but could still be convinced.

Regards,
Pete

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu