sort file/dir + flag has_print & print_dir