1.

How Can I Get At The Dos File Handle Associated With My Iostream?

Answer»

Using a combination of member FUNCTIONS fd() and rdbuf() you can get at the file handle. 

#include 

#define fstrno(s) (((s).rdbuf())->fd()) 

ifstream TEST("test.txt"); 

COUT << "handle is " << fstrno(test) << 'n';

Using a combination of member functions fd() and rdbuf() you can get at the file handle. 

#include 

#define fstrno(s) (((s).rdbuf())->fd()) 

ifstream test("test.txt"); 

cout << "handle is " << fstrno(test) << 'n';



Discussion

No Comment Found