textmode for stdout, what is "correct" now?
Corinna Vinschen
corinna-cygwin@cygwin.com
Sun Feb 17 00:11:00 GMT 2019
On Feb 16 18:13, Michael Haubenwallner wrote:
> On 2/16/19 10:38 AM, Corinna Vinschen wrote:
> > setmode(fd, O_BINARY) works on Cygwin.
>
> Well... true.
>
> What I'm trying to say is that restoring the *default* mode is currently
> broken, because traditionally the default mode simply is called "text
> mode" - which is enough for DOS only systems, but confusing in Cygwin.
>
> As for Cygwin the default mode is more complex, we may want to call it
> something like the "Cygwin text mode" instead. Consequently, the mode
> that does force \r should be called the "DOS text mode".
>
> Whether the "Cygwin text mode" is with or without \r depends on some
> other property like the text mount.
>
> However, after setting the "binary mode", libraries like openssl BIO
> want to be able to restore the "non-binary mode" - whatever name it
> may have. So they use the only available API: setmode(fd, O_TEXT).
> And IMO they're right to expect the "Cygwin text mode" on Cygwin.
>
> If they really need the "DOS text mode", they either should handle the
> \r in binary mode - or we provide some new setmode(fd, O_DOSTEXT) API.
>
> In hope to be more clear now,
> /haubi/
I really miss the problem you're trying to solve here. Why should an
application setting O_BINARY explicitely revert this decision on the
same file descriptor? That doesn't make sense.
Corinna
--
Corinna Vinschen
Cygwin Maintainer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20190217/71a7de00/attachment.sig>
More information about the Cygwin
mailing list