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

Kevin Atkinson kevina@users.sourceforge.net
Wed Feb 14 16:20:00 GMT 2001


On Wed, 14 Feb 2001, Theodore Papadopoulo wrote:

> My preference clearly would be to have a method that returns a FILE*
> corresponding to the stream. As I said in my E-mail, I believe this
> is always possible (regardless of some problems about seamless
> integration during concurrent uses of both FILE* and streams).
> And this is portable. Everything else can usually be done from this
> simple information.

C++ I/O does NOT need to be written on to of a C Stream (FILE *) even on a
Posix System.  It DOES need to written, on a POSIX system, on top of the
low level file descriptor (file number, an int).

Also a note about terminology.  In general, at least according to the GNU
libc info pages, the term "file descriptor" refers to the low-level file
number.

---
Kevin Atkinson
kevina at users sourceforge net
http://metalab.unc.edu/kevina/



More information about the Libstdc++ mailing list