开发者

extract file HANDLE from Windows file descriptor or from FILE*

Is it possible to extract file HANDLE f开发者_如何学Crom Windows file descriptor or from FILE* ?

As an example, FILE* is implemeted on top of file descriptors, and in turn file descriptors are implemented (on Windows) on top of HANDLEs. A FD can be extracted from FILE* using documented fileno() function. Extracting HANDLE from FD might be more hacking or more documented ....


Yes. See the _get_osfhandle function.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜