Hi Laurence, On Wed, Jun 26, 2013 at 12:03 AM, Laurence Tratt <lau...@tratt.net> wrote: >> Sorry, I don't follow you. As far as I know the Linux man page is not >> clear about what occurs to errno if readdir() doesn't return NULL... > > Exactly :) > (...) > This all seems a big mess to me, but since I changed my code, I've had no > problems with readdir (on OpenBSD or Linux), so I assume my defensive action > was successful...
Ok, thanks :-) I really have to wonder why Posix didn't say that readdir() returning NULL on end-of-directory simply *sets* errno to 0. Or even why it wouldn't allow both behaviors (it doesn't change anything if you set errno to 0 yourself before, and setting it to 0 is what you need in all practical cases), recommend the saner one, and so gradually phase out the old behavior. I even wonder why some systems don't implement a "readdir1()" function that does "errno=0; readdir()"... But enough pointless ranting :-) A bientôt, Armin. _______________________________________________ pypy-dev mailing list pypy-dev@python.org http://mail.python.org/mailman/listinfo/pypy-dev