From 4273625356313035737
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,a503f12190fad83c
X-Google-Attributes: gidf78e5,public
From: Barry Margolin <barmar@bbnplanet.com>
Subject: Re: What does the standard say about file descriptors
Date: 1999/10/15
Message-ID: <THsN3.890$854.36433@burlma1-snr2>#1/1
X-Deja-AN: 536880949
Distribution: world
Approved: stephen.clamage@sun.com (comp.std.c++)
References: <qqlzoxmt4em.fsf@Ike.ERC.MsState.Edu> <7u5949$2kc$1@nnrp1.deja.com>
X-UID: 0000000001
X-Status: $$$T
X-Abuse-Info: Otherwise we will be unable to process your complaint properly
X-Complaints-To: abuse@gtei.net
X-Trace: /K0ZEC0c672PQGDwr0ILEuxcyObPHVRd2tQIgIdqeOfAdt2yekwikoOiJy+YfpyuSTCOmofVsIiB!IjJMdGG8Olyk548B9v4wZAdnEb37KqUxlv9XbQipB55X9z2vDFhLTOfvVg5vPQ==
Organization: GTE Internetworking, Cambridge, MA
X-Copies-To: never
NNTP-Posting-Date: Thu, 14 Oct 1999 22:21:39 GMT
Newsgroups: comp.std.c++
Originator: clamage@taumet


In article <7u5949$2kc$1@nnrp1.deja.com>,
Dietmar Kuehl  <dietmar.kuehl@claas-solutions.de> wrote:
>This stuff is not tested and only intended to give an expression what is
>necessary to create a new stream buffer. A real implementation with
>support for seeking (not necessary for pipes...), buffering, etc. is
>somewhat more involved. Also, to enhance the performance, a real
>implementation might access stdio internals. Of course, this is then
>again not portable...

For this reason, wouldn't it be a good idea to define stdiobuf as a
standard class?  It's likely that C++ programs will have frequent need to
interact with C libraries that return FILE*, much like popen(), and it
would be nice to have a standard way to convert them to C++ iostreams.

There should be caveats about switching back and forth between using the C
and C++ interfaces on the same stream, due to each potentially doing their
own buffering, and perhaps a member function to synchronize them prior to
switching between th interfaces.

-- 
Barry Margolin, barmar@bbnplanet.com
GTE Internetworking, Powered by BBN, Burlington, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.


[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]




