开发者

extract file HANDLE from Windows file descriptor or from FILE*

开发者 https://www.devze.com 2023-04-12 10:06 出处:网络
Is it possible to extract file HANDLE f开发者_如何学CromWindows 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

精彩评论

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