220 14638 <CAFk2RUZ=3Up_JATckAakTXFYpeT9rdf2yH_jkoK3u1KMoP5xwQ@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: Ville Voutilainen <ville.voutilainen@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Native raw IO and FILE* wrappers?
Date: Wed, 19 Nov 2014 17:39:33 +0200
Lines: 46
Approved: news@gmane.org
Message-ID: <CAFk2RUZ=3Up_JATckAakTXFYpeT9rdf2yH_jkoK3u1KMoP5xwQ@mail.gmail.com>
References: <525a4bcf-c4c5-40f4-a89c-620dd543548e@isocpp.org>
	<5468B075.8030503@wanadoo.fr>
	<d01eaf9f-7645-44fd-a381-43aae0a6f638@isocpp.org>
	<FB8F296D-4A60-469F-A19B-09246507380A@gmail.com>
	<CAA7U3HNVfsnmOg+i5bQg1iff7TYp27Xfq0ZrOXf167=R0WKrfQ@mail.gmail.com>
	<90B6B49B-0202-40CD-B5E2-A7A37CF95470@gmail.com>
	<CAA7U3HMN-yCPYfp=WQWUE9aV1wUTRqYP-ov-p=-c0KsWoQsi_g@mail.gmail.com>
	<2F8BE7E9-1475-4963-B62A-5118783B6E20@gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-Trace: ger.gmane.org 1416411582 15106 80.91.229.3 (19 Nov 2014 15:39:42 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Wed, 19 Nov 2014 15:39:42 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBC5JHI7A7ALRBNPTWKRQKGQEIUED5KY@isocpp.org Wed Nov 19 16:39:36 2014
Return-path: <std-proposals+bncBC5JHI7A7ALRBNPTWKRQKGQEIUED5KY@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ob0-f197.google.com ([209.85.214.197])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBC5JHI7A7ALRBNPTWKRQKGQEIUED5KY@isocpp.org>)
	id 1Xr7Ly-0005NA-UH
	for gclcip-std-proposals@m.gmane.org; Wed, 19 Nov 2014 16:39:35 +0100
Original-Received: by mail-ob0-f197.google.com with SMTP id va2sf3808493obc.0
        for <gclcip-std-proposals@m.gmane.org>; Wed, 19 Nov 2014 07:39:34 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:mime-version:in-reply-to:references:date
         :message-id:subject:from:to:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:list-post:list-help:list-archive:list-subscribe
         :list-unsubscribe:content-type:content-transfer-encoding;
        bh=MF3yxpYO3gz3JlVFtVCUycU/dANPvcVlH1pcfHM2JpI=;
        b=aFeTOt3+eF53UksnPzViAre2GhOh4i2Qdwa98b1dK0PWy3xkS5p9VtTbaLjjZuAP3q
         V/xpwAsV+1tb97jFdxedjGt6oB2C0R1W3fts/uj858vA0XDHIrNpxGCwd3JH/yu3j/e+
         cFVDkQ3HX7lHHtfySqpOGW7FdNNFcVNJ8qpIuxnPCTn9yXw85E7m8XsiziONlFsZsHYm
         E2sJc/ga6Ca73I3xfVbyEaD0onOeOOKxefmnYlkVsLO3oo6x9NLHb0AsZy3Zycy/KNQR
         E3965iQcN8KpIwSWIxD/9xztM/7ncpAT6KOzXa8/lOKNVualf/dZaLRQN3pXHiDwDC0v
         5Fng==
X-Gm-Message-State: ALoCoQkc1V9yitZtDz9EThaOYvplZRlg1riKUWiwb64ajoPaj1+Tiulp5ikd3TCswWFTadR7STr6
X-Received: by 10.182.234.108 with SMTP id ud12mr80409939obc.0.1416411574126;
        Wed, 19 Nov 2014 07:39:34 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.182.186.100 with SMTP id fj4ls613183obc.53.gmail; Wed, 19 Nov
 2014 07:39:33 -0800 (PST)
X-Received: by 10.202.210.72 with SMTP id j69mr929017oig.87.1416411573487;
        Wed, 19 Nov 2014 07:39:33 -0800 (PST)
Original-Received: from mail-ob0-x232.google.com (mail-ob0-x232.google.com. [2607:f8b0:4003:c01::232])
        by mx.google.com with ESMTPS id 1si1373892oii.122.2014.11.19.07.39.33
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Wed, 19 Nov 2014 07:39:33 -0800 (PST)
Received-SPF: pass (google.com: domain of ville.voutilainen@gmail.com designates 2607:f8b0:4003:c01::232 as permitted sender) client-ip=2607:f8b0:4003:c01::232;
Original-Received: by mail-ob0-f178.google.com with SMTP id gq1so631899obb.9
        for <std-proposals@isocpp.org>; Wed, 19 Nov 2014 07:39:33 -0800 (PST)
X-Received: by 10.202.128.139 with SMTP id b133mr18866016oid.52.1416411573329;
 Wed, 19 Nov 2014 07:39:33 -0800 (PST)
Original-Received: by 10.76.154.2 with HTTP; Wed, 19 Nov 2014 07:39:33 -0800 (PST)
In-Reply-To: <2F8BE7E9-1475-4963-B62A-5118783B6E20@gmail.com>
X-Original-Sender: ville.voutilainen@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of ville.voutilainen@gmail.com designates 2607:f8b0:4003:c01::232 as
 permitted sender) smtp.mail=ville.voutilainen@gmail.com;       dkim=pass
 header.i=@gmail.com;       dmarc=pass (p=NONE dis=NONE) header.from=gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Google-Group-Id: 399137483710
List-Post: <http://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:14638
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/14638>

On 19 November 2014 17:18, David Krauss <potswa@gmail.com> wrote:
>> How's that a problem?
>> If it is a problem, hasn't it already been solved for FILE and fstream c=
lose()?
> It=E2=80=99s a problem that the user can accidentally pass something besi=
des an ordinary file.
> It=E2=80=99s not solved in the standard library for things that have path=
names but shouldn=E2=80=99t be buffered (e.g. in /dev).

Well, if a user decides to create a buffered stream on top of such a
descriptor, why
should we prevent that? You can already do that in posix with fdopen and th=
ere's
no particular protection against that, and it's questionable whether
any protection
is necessary.

> Creating an access interface that doesn=E2=80=99t require a pathname, and=
 therefore is specifically suited to things without names or that aren=E2=
=80=99t definitely owned by the C++ object, is pure danger.

What danger?

>>> Offering a FD wrapper
>>> supporting only files would be misleading to the user.
>>
>> If it happens to support other stuff that'd be fine with me.
> For other stuff the user would have the appearance of support but actual =
lurking errors in buffering and portability.

Also, for other stuff, the user would gain the ability to use C++
iostreams on top of a wide
variety of things where it would work, and does work with existing
extensions just fine, like pipes.

--=20

---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

.
