<p>There&#39;s no such thing as a file descriptor number in .NET -- or, for that matter, in Windows itself! :)&nbsp; (The latter is something of a semantic point, of course, as a HANDLE serves something of the same role in Win32 as a file descriptor number does in Unix.)</p>

<div>If you have a FileStream, I think you can turn it into a Windows HANDLE by saying<br>IntPtr handle = stream.SafeFileHandle.DangerousGetHandle();<br>The C library should have a way to convert a HANDLE into a &quot;file descriptor&quot;, though I wasn&#39;t able to identify the function name with a quick google.<br>
I don&#39;t see a way to get handles for stdin, stdout or stderr, though, except that these ought to be easy to translate by hand.</div>
<div>&nbsp;</div>
<div>
<div class="gmail_quote">On Mon, Dec 15, 2008 at 8:03 AM, Tom Wright <span dir="ltr">&lt;<a target="_blank" href="mailto:tom.wright@resolversystems.com">tom.wright@resolversystems.com</a>&gt;</span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">Hi,<br><br>At the moment file.fileno() returns an arbitrary identifier of a python file rather than a true file descriptor. This is semi-blocking the Ironclad port of PIL.<br>
<br>Code in PIL gets an integer using fileno() and passes it directly to C code where a call to write() is made. To fix this &nbsp;one would have to patch PIL, IronPython&#39;s file objects or the write function provided to C code - none of these feel like a good course of action.<br>
<br>When ctypes is ported to IronPython this may create similar problems. Ideally fileno() would return a real file descriptor. Would this be possible?<br><br>Thanks,<br><br>Tom<br>Resolver Systems<br>_______________________________________________<br>
Users mailing list<br><a target="_blank" href="mailto:Users@lists.ironpython.com">Users@lists.ironpython.com</a><br><a target="_blank" href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><br>
</blockquote></div><br></div>