Windows上でmingwを使ってC ++のiostreamに関連付けられたWindows
FileHandleが必要です。これはおそらく、Windows上のC ++
iostreamに関連付けられているUNIXファイル記述子と同じです。誰もそれを見つける方法を知っていますか?ありがとう。
ベストアンサー
Did you see my answer, here:
How do I flush a stdlib output file on win32?
std::basic_filebuf *file_buf = dynamic_cast *>(f.rdbuf());
if (file_buf != 0) {
struct to_get_protected_member : public std::basic_filebuf {
int fd() { return _M_file.fd(); }
};
printf("your fd is %dn", static_cast(file_buf)->fd());
}