Chenge geting filenames function to scandir