This function recursively scans the input directory and returns a list of all files and sub-folders.