The question has come up recently (both here and in my contracting work)
about alphabetizing the aliases and forwards as they show up in qmailadmin.
There is a possible way to do this using scandir(3). Is this not portable?
Or is there another reason why this isn't used? Or was it just not
considered?

Based on the Linux scandir(3) man page, the current code in qmailadmin:

  mydir = opendir(".")...
  [...]
  while ((mydirent=readdir(mydir)...

should be able to be replaced with:

  struct dirent **direntlist;
  rc = scandir(".", &direntlist, 0, alphasort);
  if (rc < 0)
    /* error */
  else
    while (rc--) {
      strcpy (filename,direntlist[rc]->d_name);
      /* do stuff with filename */
    }

Okay, that'll get it in reverse order, but you get the point. So is this
possible/advisable? I'd be happy to code it and provide a patch if it's cool
with Ken (and if I can get it into the main source tree)...

/pg
-- 
Peter Green : Gospel Communications Network, SysAdmin : [EMAIL PROTECTED]
---
Q: Why shouldn't I simply delete the stuff I never use, it's just taking up 
   space?
A: This question is in the category of Famous Last Words..
(From the Frequently Unasked Questions)

Reply via email to