> So will the new libstdc++ provide such a way? If you compile the current CVS libstdc++ with _STREAM_COMPAT, you get a filedesc() method on an fstream object, returning the file descriptor. Alternatively, you can use fstream::rdbuf()->fd() (which filedesc() is a short-hand for). Regards, Martin