[GRASS-dev] r.colors: rules file list unsorted

Glynn Clements glynn at gclements.plus.com
Sun Jan 28 19:06:21 EST 2007


Wolf Bergenheim wrote:

> > from the scandir(3) man page:
> > 
> > CONFORMING TO
> >        None of these functions is in  POSIX.   LSB  has  deprecated  the
> >        library call alphasort() and never contained scandir().
> > 
> >        The  functions  scandir()  and  alphasort() are from BSD 4.3, and
> >        have been available under Linux since libc4.  Libc4 and libc5 use
> >        the more precise prototype
> > 
> >        int alphasort(const struct dirent **a, const struct dirent **b);
> > 
> >        but glibc 2.0 returns to the imprecise BSD prototype.
> > 
> >        The  function  versionsort()  is a GNU extension, available since
> >        glibc 2.1.  Since glibc 2.1, alphasort() calls  strcoll(3);  ear-
> >        lier it used strcmp(3).
> > 
> > 
> > 
> > .. a POSIX compliant solution would be nice,
> > 
> 
> My man says:
> 
> CONFORMING TO
>         None of these functions is in POSIX.1-2001, but  alphasort()  and
>         scandir()  are  under  consideration  for  a  future  revision to
>         POSIX.1.
> 
> So would that satisfy you?

Not me; use opendir/readdir/closedir + qsort instead.

MinGW provides implementations of these functions on Windows, or you
can use the native functions FindFirstFile, FindNextFile and FindClose
instead.

-- 
Glynn Clements <glynn at gclements.plus.com>




More information about the grass-dev mailing list