invoke closedir after invoke opendir