is_leaf_dir
if ((level == 1 && is_dir && is_leaf_dir(fpath)) ||
(level >= 2 && is_dir && is_leaf_dir(fpath))) {