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
Wed Feb 14 22:44:00 GMT 2001


Jon Cast <jcast@ou.edu> writes:

| 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.  

No, you get it wrong.

A code perfectly well-defind under C/Unix will continue to be
perfectly well-defined under C++/Unix. Nothing is broken.

-- Gaby
CodeSourcery, LLC                       http://www.codesourcery.com



More information about the Libstdc++ mailing list