Larry Hastings <la...@hastings.org> added the comment:

Well, there's no os.fdopendir(); I think you're referring to fdlistdir(), which 
uses the C function fdopendir() internally.  The DIR structure is not exposed 
to the Python caller at any point.

I did miss the whole opendir-returns-a-DIR-not-a-fd thing, hopefully that's my 
dumb thing of the day.  This suggests opendir() would have to call dirfd() on 
your behalf.

Would it be safe to call close() on the fd returned from dirfd(opendir())?  If 
not, I guess we'd need a special closedir() function, which would use the C 
functions fdopendir() then closedir() internally.

... or we could forget the whole thing, I guess.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue12898>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to