C++ Streams and the underlying file descriptor

Kevin Atkinson kevinatk@home.com
Sat Apr 1 00:00:00 GMT 2000


Although not strictly defined by the C++ standard on almost all POSIX
system all Filo IO has to done on top of file descriptors.  However the
C++ standard defines NO way of getting to the underlying descriptor. 
However, in my view, there ought to be a standard way of accessing the
underlying file descriptor and creating a C++ stream from an existing
descriptor on all POSIX systems.  Will the new libstdc++ provide such a
way?  

I release I can create easily create a custom streambuf which uses read
and write or even the higher level fread and fwrite.  However this is
bound not to be nearly as fast as the standard C++ streams.

I release that C++ streams do not necessarily have to written on top of
C *streams* however on unix systems they basically have to written on
top of *file descriptors*.  Because gcc basically is primary designed
for unix and unix like systems, there ought to be a standard way of
accessing the underlying file descriptor and creating a C++ stream from
an existing descriptor.

So will the new libstdc++ provide such a way?

-- 
Kevin Atkinson
kevinatk@home.com
http://metalab.unc.edu/kevina/


More information about the Libstdc++ mailing list