This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
RE: Getting a file descriptor or a file number) for an fstream (Was:Accessing the underlying file descriptor in fstream)
- To: Gabriel Dos Reis <gdr at codesourcery dot com>
- Subject: RE: Getting a file descriptor or a file number) for an fstream (Was:Accessing the underlying file descriptor in fstream)
- From: Jon Cast <jcast at ou dot edu>
- Date: Thu, 15 Feb 2001 00:17:11 -0600
- Cc: libstdc++ at gcc dot gnu dot org
Gabriel Dos Reis [gdr@codesourcery.com] writes
> Well let's make this straight. The thing on top of which IOStreams are
> implemented aren't directly accessible to you.
In C the underlying mechanism of a FILE* _is_ available, in practice even if
not in theory. So what you're saying is, code that is perfectly
well-defined under C/Unix should not be possible under C++/Unix without
sacrificing the major advantages of C++ for I/O. That, IMAO, is a
legitimate QOI issue, not some essential sacrifice to the dread god of
`portability'.
If your concern is for abstraction, then I would say this is an area where
ease of use trumps abstraction. It isn't any good to abstract your
interface to the point of breaking well-defined and useful code. That kind
of code, if it became prevalent, would be asking for a fork.
Jon Cast