title: Is there a Windows equivalent to fdopen for HANDLEs?
body: <p>In Unix, if you have a file descriptor (e.g. from a socket, pipe, or inherited from your parent process), you can open a buffered I/O <code>FILE*</code> stream on it with <a href="http://linux.die.net/man/3/fdopen"><code>fdopen(3)</code></a>.</p>
  
  <p>Is there an equivalent on Windows for <code>HANDLE</code>s?  If you have a <code>HANDLE</code> that was inherited from your parent process (different from stdin, stdout, or stderr) or a pipe from <code>CreatePipe</code>, is it possible to get a buffered <code>FILE*</code> stream from it?  MSDN does document <a href="http://msdn.microsoft.com/en-us/library/dye30d82%28v=vs.80%29.aspx"><code>_fdopen</code></a>, but that works with integer file descriptors returned by <code>_open</code>, not generic <code>HANDLE</code>s.</p>