|
From: Tor L. <tm...@ik...> - 2002-10-24 19:02:58
|
Lev Serebryakov writes: > I have one question: is result of open() call in mingw32 is > old-good-plain Win32 HANDLE or not? No. It is a small nonnegative integer, just like file handles on Unix. But unlike Unix, it isn't anything that the operating system itself knows about. It's the Microsoft C runtime that has a (per-process) table with various data for each such "file handle". For instance the actual HANDLE in a field in the table. The "file handle" is the index into that table. You can't access that table directly, but you can read and set certain fields of it with some C runtime functions. For instance, you can get the HANDLE corresponding to a "file handle" with the function _get_osfhandle(), declared in <io.h>. Or, you create a "file handle" corresponding to an already open HANDLE using _open_osfhandle(). (This really doesn't have much to do with mingw; this stuff is in the Microsoft C runtime library msvcrt.dll, and valid for MSVC, too.) > possible in any case... Is _pipe() supported by mingw32? Of course. (Not that mingw has to do anything in particular to "support" it.) --tml |