Sort directory entries before listing them