alphasort

Name

alphasort -- compare two directory entries alphabetically (LSB deprecated)

Synopsis

#include <dirent.h>

int alphasort((const struct dirent **a), (const struct dirent **b));

Description

alphasort is expected to disappear from a future version of the LSB; applications should provide their own routine to sort filenames. [1]

alphasort can be used as the comparison function for the scandir function to sort directory entries into alphabetical order. Its parameters are the two directory entries, a and b, to compare.

Return Value

alphasort returns an integer less than, equal to, or greater than 0, where a is considered to be less than, equal to, or greater than b, respectively.

Errors

ENOMEM

Insufficient memory to complete the operation.

Notes

[1]

The LSB never has contained scandir.