xlistdir.xlistdir is an iterator version of os.listdir.
This initial hack will probably not even compile on anything non-posix (e.g. mswin32, mswin16, OS/2) because I do not have access to those platforms. If you do, please help.
It does include a unit test, and it does pass for me on Linux. 8-)
Most of this code was cut and pasted from xreadlinesmodule.c and posixmodule.c in Python-2.2.2.tgz
(the -rNNN is nothing more than the head revision number from my subversion repository. If the number has changed, the code has changed, but the rate of change is nearly meaningless.)