How to construct a c++ fstream from a POSIX file descriptor?

后端 未结 7 2078
情歌与酒
情歌与酒 2020-11-22 12:36

I\'m basically looking for a C++ version of fdopen(). I did a bit of research on this and it is one of those things that seems like it should be easy, but turns out to be v

7条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-22 12:41

    It actually is quite easy. Nicolai M. Josuttis has released fdstream in conjunction with his book The C++ Standard Library - A Tutorial and Reference. You can find the 184 line implementation here.

提交回复
热议问题