sort the list of files in the scan directory