From: Tor L. <tm...@ik...> - 2009-09-24 07:40:32
|
> do you know if there > is a way to open a stdio FILE pointer from a win32 HANDLE? something like fdopen(_open_osfhandle(handle, _O_BINARY), "rb"). Check MSDN and mingw headers for details. Note that it doesn't work for random HANDLEs, only for HANDLEs to things that can be read and written with ReadFile and WriteFile I assume. File and (anonymous) pipe handles, maybe console handles. > (Maybe I > can fwrite() straight to the HANDLE pointer?) No way... just like you can't fwrite() to a file descriptor on POSIX. (But note that the likeness is not 100%; on Windows the "file descriptors" (the small integers that open() etc return and use) are just indexes into a table specific to the C library instance, the kernel (or the Win32 subsystem) knows nothing of them.) --tml |