|
|
From what I have seen, most examples ignore errno and just check the
return value for NULL.
On Tue, Jun 15, 2021 at 1:22 PM Mark Olesen ***@***.***> wrote:
>
> DOS, OpenWatcom
> For reference, you can also see the posix man page
>
> https://pubs.opengroup.org/onlinepubs/009695399/functions/readdir_r.html
>
>
> On Tue, Jun 15, 2021 at 7:19 AM Albrecht Schlosser ***@***.***> wrote:
>>
>> Further investigation reveals a conflict which I don't know how to solve. It's maybe only a theoretical problem but anyway, here it is: The POSIX man page of readdir(3p) states under "ERRORS":
>>
>> ENOENT The current position of the directory stream is invalid.
>>
>> This would be considered an error and scandir should return -1. However, your suggestion would turn this error into an End of Directory condition and return as many files as have been read up to the error.
>>
>> So, what would be the correct behavior?
>>
>> We can assume that our implementation is only used if the "POSIX scandir()" calling interface is not available, but this doesn't automatically mean that readdir() does not conform to POSIX.
>>
>> Solving the issue as you @markjolesen propose might break on other systems in unforeseen ways. :-(
>>
>> Any comments or suggestions?
>>
>> —
>> You are receiving this because you were mentioned.
>> Reply to this email directly, view it on GitHub, or unsubscribe.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.
[ Direct Link to Message ] | |
|
| |