use dirent struct d_type attribute to check if file