[Python-Dev] My summary of the scandir (PEP 471)
Jonas Wielicki
j.wielicki at sotecware.net
Tue Jul 1 20:45:22 CEST 2014
On 01.07.2014 17:30, Ben Hoyt wrote:
>> No need for a microsecond-timed deletion -- a directory with +r but
>> without +x will allow you to list the entries, but stat calls on the
>> files will fail with EPERM:
>
> Ah -- very good to know, thanks. This definitely points me in the
> direction of wanting better control over error handling.
>
> Speaking of errors, and thinking of handling errors during iteration
> -- in what cases (if any) would an individual readdir fail if the
> opendir succeeded?
readdir(3) manpage suggests that readdir can only fail if an invalid
directory fd was passed.
regards,
jwi
>
> -Ben
>
More information about the Python-Dev
mailing list