This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Getting a file descriptor or a file number) for an fstream (Was:Accessing the underlying file descriptor in fstream)


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]