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) michaelbaeuerle Jun 16, 2021  
 

@Albrecht-S The header of "scandir_posix.c" says:

This implementation of 'scandir()' is intended to be POSIX.1-2008 compliant.
A POSIX.1-1990 compliant system is required as minimum base.

This should be read as "This implementation needs a POSIX.1-1990 API from the operating system".

[OTOH: the reason to provide fl_scandir() is to support systems that lack a POSIX scandir() function. Isn't it to be expected that readdir() is not POSIX compliant on such systems as well?]

No. Back then I have written this scandir() implementation for old versions of Solaris.
They are even POSIX (or UNIX respectively) certified, but for older versions of the standard, that predate scandir().

The problem with this (or any other) approach is how to determine the "broken platform" ...

The simple solution would be:

$ getconf _POSIX_VERSION
200809

If the "getconf" utility is not available, it likely is not Unix.
If it is Unix and it reports at least the value "200809" (POSIX.1-2008), then it should provide a usable scandir().
If it is Unix and it reports at least the value "199009" (POSIX.1-1990), then it should provide a usable readdir().

I would not expect a POSIX conformant API from an operating system like DOS or Windows at all.
That existing functions may have the same names says nothing about their behaviour.


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'.