FLTK logo

Re: [fltk/fltk] scandir_posix.c readentry should check for ENOENT (#238)

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.issues  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: [fltk/fltk] scandir_posix.c readentry should check for ENOENT (#238) Mark Olesen Jun 15, 2021  
 

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 ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.