[Python-Dev] IO module improvements (original) (raw)

David Cournapeau cournape at gmail.com
Sat Feb 6 08:46:34 CET 2010


On Sat, Feb 6, 2010 at 4:31 PM, Tres Seaver <tseaver at palladion.com> wrote:

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1

Antoine Pitrou wrote: Pascal Chambon <pythoniks 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"?). File descriptors are integer indexes into a process-specific table.

AFAIK, they aren't simple indexes in windows, and that's partly why even file descriptors cannot be safely passed between C runtimes on windows (whereas they can in most unices).

David



More information about the Python-Dev mailing list