if ((*d1)->d_type == (*d2)->d_type) return alphasort(d1, d2);\r
if ((*d1)->d_type == DT_DIR) return -1; // put before\r
if ((*d2)->d_type == DT_DIR) return 1;\r
if ((*d1)->d_type == (*d2)->d_type) return alphasort(d1, d2);\r
if ((*d1)->d_type == DT_DIR) return -1; // put before\r
if ((*d2)->d_type == DT_DIR) return 1;\r