delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2019/02/16/04:39:11

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:to:subject:message-id:reply-to
:references:mime-version:content-type:in-reply-to; q=dns; s=
default; b=WclHm8LemFgSNzlhLRuJmHcKEKRQ8+7SdqRXw8kZVuVZ2IZkMC+tG
licxce9/GKa1I6I+M/O/3p2HQMxoVp4NJ1hw1cRGazw+dxqLyGsasRq4Z6V3t7pp
lapJeWiH1CQoeszWLzfATSMWt49NoosigUb/YSTIxNj5OJ1oa8dlqM=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:to:subject:message-id:reply-to
:references:mime-version:content-type:in-reply-to; s=default;
bh=ARx6R+NtybAAkCY88R3hl36d5tc=; b=K0pb/QdDtihscLZlGATX7c7HA0S6
kk+PVxdL2W5LcjWZgnZ0huv2sdYcz7zXqr60HGmaDTMucpmfYLRvjJV0kplO2fgn
Flozxa9PepLK5krpybDXegHuWabyoPvkuZspbFPX40nbUXuKwUlWKcHq2pBbYCwE
01tA7F7EUtHSt6A=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Spam-SWARE-Status: No, score=-100.9 required=5.0 tests=BAYES_00,GOOD_FROM_CORINNA_CYGWIN,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy=family
X-HELO: mout.kundenserver.de
Date: Sat, 16 Feb 2019 10:38:55 +0100
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: textmode for stdout, what is "correct" now?
Message-ID: <20190216093855.GR2702@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <739ed5ce-6902-d702-e152-65dc2c1da667 AT ssi-schaefer DOT com> <20190214162002 DOT GA4950 AT calimero DOT vinschen DOT de> <6aa280c2-4769-0772-91d9-c73a3a3d9680 AT ssi-schaefer DOT com> <20190215102251 DOT GA2702 AT calimero DOT vinschen DOT de> <f7345109-5b22-a342-df1e-940e236c2397 AT ssi-schaefer DOT com> <20190215124844 DOT GE2702 AT calimero DOT vinschen DOT de> <6d02258d-115d-135c-1404-1b02eec34045 AT ssi-schaefer DOT com> <20190215203108 DOT GN2702 AT calimero DOT vinschen DOT de> <f1372893-842b-93e1-f0f2-3a9f3ac02e20 AT ssi-schaefer DOT com>
MIME-Version: 1.0
In-Reply-To: <f1372893-842b-93e1-f0f2-3a9f3ac02e20@ssi-schaefer.com>
User-Agent: Mutt/1.10.1 (2018-07-13)

--ggdAeHltlv4tpqCr
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Feb 16 09:19, Michael Haubenwallner wrote:
> On 2/15/19 9:31 PM, Corinna Vinschen wrote:
> > On Feb 15 19:07, Michael Haubenwallner wrote:
> >> On 2/15/19 1:48 PM, Corinna Vinschen wrote:
> >>> On Feb 15 13:03, Michael Haubenwallner wrote:
> >>>> On 2/15/19 11:22 AM, Corinna Vinschen wrote:
> >>>>> On Feb 15 08:56, Michael Haubenwallner wrote:
> >>>>>> On 2/14/19 5:20 PM, Corinna Vinschen wrote:
> >>>>>>> On Feb 14 16:23, Michael Haubenwallner wrote:
> >>>>>>>> Hi,
> >>>>>>>> [SNIP]
> >>>>>> Down the line in their BIO module they do use setmode(fd, O_TEXT),
> >>>>>> which is the one that does introduce the \r, as far as I know.
> >>>>>
> >>>>> This one is not so nice.  Somebody should tell upstream we only
> >>>>> want explicit O_BINARY these days, but no explicit O_TEXT.
> >>
> >> To me it sounds strange to use the one but not the other:
> >>
> >> If we don't want O_TEXT at all, isn't O_BINARY obsolete as well,
> >> so the advise should be to use neither - just like real *nix?
> >=20
> > No, on text mode mounts O_BINARY makes sure that the result is
> > actually a binary file.
> >=20
> >> A consequence then might be to deprecate (or even remove) them
> >> from the public API header files.
> >=20
> > As long as we have text mode mounts, no.
>=20
> Ah... So this feels like a semantic confusion around setmode(O_TEXT):
>=20
> For the fopen() API family, POSIX says that conforming platforms should
> accept (and eventually ignore) the 'b' character in the mode argument.
> But note that there is no 't' character specified here.
>=20
> So with the fopen() API family, application developers are able to
> enable or disable binary mode, but are _not_ able to explicitly
> enable or disable text mode.
>=20
> Unfortunately, the setmode() API is semantically different, because it
> does not allow to disable binary mode, but to "enable text mode" instead.
>=20
> So with the setmode() API, when application developers want to disable
> binary mode, their only option is to "enable text mode".

setmode(fd, O_BINARY) works on Cygwin.


Corinna

--=20
Corinna Vinschen
Cygwin Maintainer

--ggdAeHltlv4tpqCr
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEoVYPmneWZnwT6kwF9TYGna5ET6AFAlxn2i8ACgkQ9TYGna5E
T6B1pxAAjk7b4D6204CC2fXY0Omxs2/ETbBHgvrGan8Avk97Xzy/nZD/2Id1ks9f
eve1fH7DMduljd1qa248nuRgsUpQu2WiFwxBYww8ZRTkNuq1X0FFuycgwkUbBMLO
xGqNiKTyFo9L4pIa7lkP3a/nPKG+6PZXIknEe5eqmDim891U2j+2rvWd7O25Cvd/
cnDkHLitehG1IajYHHLAnONw+nFQ7wtXnbNpkvuiBqJrcqBXECiu0lrIMFPJSfMU
nO88mUm1ZOOAoHqFhyE1GfJNdzF1/T3d/lRbU0VcAxzDpBkTdOgnaMMuLWCaFQqn
wcfh9f0yEygUoZNQAHD7b12apUVZO7dwrNzoGQ418J0ylqbtG8kfpL68osr+T3yQ
/MSnG7grKNzYgh0jKIrEHbQXuAxadq+c6+r9LBaoNqm86XJCNyLXjLktBv0/fIsO
OrBmClLrAVJrLBs7zCGxJkgMDzIqmeCqOokKfZcLJrejC+UMjjNfOGbrjvUxrqeu
rcIsg+VW9lDQ7xVqBigG80r96ctYk5SvePzcTWWKkVdNuFf5G9ovx6h9yEj2NeF6
zc3IR3iJLn2IjU3zN4Hv3kgaKel3pHmXGuYVwHk8fY6FmMkE6iqSKrs+ohgwvhU5
dQdE9E/EuyzVuJF78HJfFJUuwky2zJyh5VwpkUiMyCECoFRsg/I=
=AlDJ
-----END PGP SIGNATURE-----

--ggdAeHltlv4tpqCr--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019