Web lists-archives.com

Re: textmode for stdout, what is "correct" now?




On Feb 18 15:45, Michael Haubenwallner wrote:
> On 2/18/19 2:15 PM, Corinna Vinschen wrote:
> > You have two modes for input and three for output:
> > 
> > - input O_BINARY  -> only \n
> > - input O_TEXT    -> \n and \r\n
> > 
> > - output 0        -> generates \n or \r\n depending on mount mode
> > - output O_BINARY -> generates \n
> > - output O_TEXT   -> generates \r\n
> 
> Erm, even for input there is mode 0: strips \r depending on mount mode.

Right.

> This actually is without using setmode() at all.
> Shouldn't the default (mode 0) behave like O_TEXT for input?

POSIXy binary mode is the only sane default.  Apps reading binary input
would start to misbehave otherwise.  That's why text mount mode should be
used with care :}


Corinna

-- 
Corinna Vinschen
Cygwin Maintainer

Attachment: signature.asc
Description: PGP signature