[Python-Dev] IO module improvements

David Cournapeau cournape at gmail.com
Sat Feb 6 13:25:33 CET 2010


On Fri, Feb 5, 2010 at 10:28 PM, Antoine Pitrou <solipsis at pitrou.net> wrote:
> Pascal Chambon <pythoniks <at> gmail.com> writes:
>>
>> By the way, I'm having trouble with the "name" attribute of raw files,
>> which can be string or integer (confusing), ambiguous if containing a
>> relative path, and which isn't able to handle the new case of my
>> library, i.e opening a file from an existing file handle (which is ALSO
>> an integer, like C file descriptors...)
>
> What is the difference between "file handle" and a regular C file descriptor?
> Is it some Windows-specific thing?
> If so, then perhaps it deserves some Windows-specific attribute ("handle"?).

When wondering about the same issue, I found the following useful:

http://www.codeproject.com/KB/files/handles.aspx

The C library file descriptor as returned by C open is emulated by
win32. Only HANDLE is considered "native" (can be passed freely
however you want within one process).

cheers,

David


More information about the Python-Dev mailing list