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 08:50:00 GMT 2001


Theodore Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr> writes:


[...]

| The problem is not so how is implemented iostream but can we convert 
| what is used to a FILE* or an int (to keep only my 1) and 2) 
| variants). 

If your need is to have a C++ ISOstream operating over a FILE* C or a
int, then it should be not be hard to implement your own class
(derived from standard stream classes) to implement your policy.
Passing them back to the rest of the standard algorithms should be
trouble-less. 

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



More information about the Libstdc++ mailing list