Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Ian Collins Newsgroups: comp.lang.c++ Subject: Re: Create an istream from an fd? Date: Sun, 28 Aug 2011 15:56:58 +1200 Lines: 19 Message-ID: <9btskaFopsU6@mid.individual.net> References: <27743f07-a009-4f80-aa2f-5ab9dd9fdd9a@19g2000vbv.googlegroups.com> <9bqok6FeijU2@mid.individual.net> <9btaq6FopsU5@mid.individual.net> <2be71f2e-9a18-42ab-a7ec-bc7f8ccb215e@i9g2000yqk.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net FdwFjPwu7E4wewTeUbARHQqzutMpIQOmWHH6/O256bEXEhCasJ Cancel-Lock: sha1:JFTmYoVxqwGQ/nw6tRKvp72ceYI= User-Agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:1.9.2.9) Gecko/20101021 Lightning/1.0b2 Thunderbird/3.1.4 In-Reply-To: Xref: x330-a1.tempe.blueboxinc.net comp.lang.c++:9388 On 08/28/11 03:31 PM, Nobody wrote: > On Sat, 27 Aug 2011 16:35:12 -0700, James Kanze wrote: > >> (The standard could have required an implementation defined >> typedef for the file descriptor in filebuf, and a constructor >> for that, but as far as I know, no one proposed such a thing.) > > It could have required a version of filebuf::open() (or similar) taking > a FILE*, given that is part of the standard. Then you would end up with two layers of buffering and considering the similarity between C's fopen and constructing an fstream, gain very little. It also wouldn't solve one of the most common (at least for me) requirements: a stream over an existing file descriptor that isn't a regular file. -- Ian Collins